1

I am using ngnix infront of 4 instances of node.js apps running on 1 machine (quad core)

Can any ngnix experts give me any advice on how to configure this to get the most out of the web app.

I am using connect/express frameworks on node and I think they allow smart caching etc, but I am not sure which bits to let ngnix do and which bits to let the frameworks handle. Any guidance on getting the most out of this setup will be a great help, thanks.

2
  • 1
    interesting setup. take a look at deftserver.org if you are interested in some nginx/node.js performance benchmarking Commented Oct 10, 2010 at 15:55
  • Got a feeling defserver is going to be popular with the Java community. Looks impressive. Commented Oct 10, 2010 at 21:53

1 Answer 1

2

You need to take into account that any one Node instance will use several threads, and will probably keep at least one thread occupied with I/O. So say that you run 4 instances on a quad core, that means that all 4 instances will produce blocking threads, meaning that you have at least 4 blocking threads (if you have a busy server) meaning that you will at some point block all activity for short periods.

I would suggest not starting more than (number of cores)-1 instances of Node, to be half sure that at least something always keeps moving.

I do assume that there is one blocking thread per Node instance, but I could be wrong. There could be more. But the point remains the same. The more "free" threads you start, the more "blocking" threads will be created as well.

Sign up to request clarification or add additional context in comments.

2 Comments

Interesting, I am now thinking of going down to one instance then. The web app has nothing blocking as far as I can see. As I have other stuff running on the server (being a cheapskate) like mongodb and redis. I may even need ffmpeg or some such later. Do you think 1 behind ngnix ok? Would you considen dropping nginx altogether?
i haven't used connect or express so i can't say what it can or cannot do compared to nginx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.