Ask HN: Are dynamic languages fast enough for dynamic sites on low-end hardware?
If you have low-end server hardware (e.g. 1GB or 2GB memory shared CPU hosting) will a dynamic scripting language (Python, Ruby, PHP, Javascript) perform fast at serving dynamic pages? At what point will the language struggle where more performant languages might breeze through?
I know this might a bit like asking how long is a piece of string, but let's say 1000 users are concurrently accessing the site's pages which are mostly being dynamically generated. Would this be a breeze for dynamic languages on low-end hardware?
4 comments
[ 5.1 ms ] story [ 19.3 ms ] threadThe real answer depends on some assumptions I'm making and questions
Assumption #1 - You're doing server side rendering because you talk about dynamically generated pages and not API response times.
Assumption #2 - You're using a database and it will be on the same instance as the web server.
Assumption #3 - You have one web server instance.
A web app that is focused on serving static assets with little customization, say putting a user name in the header and a separate profile page, could be fine if you use a CDN for the static assets and don't call the DB excessively.If you're calling the DB 200 times to generate a page, doing long running queries, or a lot of computation in the app layer you might be in trouble. (With my hypothetical 200 DB calls to load a page you're certainly not in a great spot :))
Does anyone know how to format a list? I can't figure out the magic incantation and https://news.ycombinator.com/formatdoc isn't helping much.
That said, if any of the page renderings can be shared between users, such as using a framework that can do page fragment caching then you can approach that level especially if you can cache entire responses using nginx.