Tag Archives: performance

10 Tips to Make Your Node.js Web App Faster

Node.js is already blazing fast thanks to its event driven and asynchronous nature. But, in the modern web just being fast is not enough. If you are planning to develop your next web app using Node.js you must take every possible step to make sure your app is faster than usual. This article presents 10 tips that are known to speed up your Node based web app tremendously. So, let’s see each of them one by one.

10 Tips to Make Your Node.js Web App Faster

Node.js is already blazing fast thanks to its event driven and asynchronous nature. But, in the modern web just being fast is not enough. If you are planning to develop your next web app using Node.js you must take every possible step to make sure your app is faster than usual. This article presents 10 tips that are known to speed up your Node based web app tremendously. So, let’s see each of them one by one.

Why serving files with nodejs is faster than apache when I use a single mongodb connection? [closed]

Salam (means Hello) :)

I'm trying to improve speed of my nodejs website which depends on some mongodb operations and serving some static files. I'm using node-mongodb-native driver. as far as I know:

  1. Nodejs is slow on serving static files, nginx or apache are better options for this task.
  2. Caching a single db object and using it during application run time, is faster than calling MongoClient.connect() for every database operation.

nginx is not currently an option for me. So using a single db connection along side using apache for static files should be fastest combination, but tests on a semi-production environment don't verify this theory:

file server / db connection : speed  

nodejs / multiple : 24895ms
apache / multiple : 10770ms

nodejs / single   :  7068ms
apache / single   : 14995ms

So why when using multiple connections, apache makes my application load faster, and when using a single connection, apache makes my application load slower?