Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to nginx, and I am using it currently on my server to serve videos to users. a few days ago the server started becoming extremely slow while have around 500-600 users online, note that I have a 1gbps line on the server so its not the bandwidth. it takes the server around a minute or 2 to respond but once the file starts streaming the speed is decent, so its taking the server long to spot the file I guess! I was wondering if anyone knows how I can fix this? I have already tried increasing the open file limit and worker limit, but still not luck!!!

I am also interested to hire someone to fix this for me if they know how to do it exactly and have previous experience with a similar situation.



         total       used       free     shared    buffers     cached
Mem:          7861       7695        166          0          3       4233
-/+ buffers/cache:       3459       4402
Swap:         4095         44       4051
share|improve this question
Do you have any performance metrics graphed or stored? Cpu, i/o wait, ram usage etc. – 3molo Mar 27 '12 at 6:36
unfortunately I do not have a control panel on the server to graph anything!! – Ahoura Ghotbi Mar 27 '12 at 6:38
I added the memory usage – Ahoura Ghotbi Mar 27 '12 at 6:40
video files are served from local disk? If so, i/o is highly relevant. – 3molo Mar 27 '12 at 6:47
they are, but to be honest I am not sure how to get the i/o via ssh!! it would be helpful if you could help me out there too. – Ahoura Ghotbi Mar 27 '12 at 6:49

So, you need to work from the bottom-up to find the bottleneck. I wrote a fairly comprehensive article on finding performance bottlenecks a couple of years ago, which should be helpful.

In short, you need to identify the exact system component that's the source of the problem (using tools like sar or it's many equivalents), then fix it. Once you fix that, something else will become the bottleneck, so you repeat the process until performance is acceptable.

In your specific case, disk I/O might be the problem, but the complicating factor is the fact that it takes a long time for requests to be serviced but they stream OK. I'd be looking into where the holdup there is -- is the kernel establishing the TCP connection quickly (look for the three-way-handshake with tcpdump), is nginx getting an accept through quickly (strace nginx and it's workers), is the HTTP request processing taking a while (nginx log files at maximum debug, cap'n)? A methodical approach to problem-solving will cure many ills.

(As an aside, whilst I don't do consulting, I do work for a hosting company that specialises in full-stack system support, so if you need paid help, it's always there)

share|improve this answer
hey, how can I contact you? – Ahoura Ghotbi Mar 27 '12 at 18:03
I don't do private support; my employer's details are linked to from my profile if that's what you're after. – womble Mar 27 '12 at 19:44
Link to the article is broken. Could you update it? – SergeanT Dec 15 '14 at 6:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.