Memcached error when running siege

  • Posted on July 28, 2013
  • msambareAsked by msambare


I am kind of new to server setups. I installed Nginx + NGX Pagespeed + PHP FPM + APC + MemCached on Ubuntu 12.04 and topped all of this with Joomla 3.1

All works well except when I try to run siege for load testing. When I use the -b parameter with siege (benchmarking), I start getting a 502 error immediately. Even if I bring the concurrent connections down to 2, I still get the error.

The site goes down and even in a browser, I get a 502 error. With some research, I think the issue is with the persistent connections in Memcached however I have no clue on how and where to tweak the configuration. In fact, I do not know how to proceed :-(

When I run siege, without the -b switch, and even with 50 users - all works fine.

Will appreciate some guidance preferably if you can point me to some links / tutorials.

Thanks and regards, Mangesh

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Issue resolved. It was actually with PHP FPM listening on Unix socket. Changed it back to TCP.

Well, I added Swap and the 502s have gone :) <br> <br>But now Siege reports a different error: <br> <br>siege aborted due to excessive socket failure <br> <br>On doing some research, found an article on Stack Overflow which states the following: <br> <br>The problem may be that you run out of ephemeral ports. To remedy that, either expand the number of ports to use, or reduce the duration that ports stay in TIME_WAIT, or both. <br> <br>Expand the usable ports: <br> <br>Check your current setting: <br> <br>$ sudo sysctl net.inet.ip.portrange.hifirst <br> <br>net.inet.ip.portrange.hifirst: 49152 <br> <br>Set it lower to expand your window: <br> <br>$ sudo sysctl -w net.inet.ip.portrange.hifirst=32768 <br> <br>net.inet.ip.portrange.hifirst: 49152 -> 32768 <br> <br>(hilast should already be at the max, 65536) <br> <br>Reduce the maximum segment lifetime <br> <br>$ sudo sysctl -w net.inet.tcp.msl=1000 <br> <br>net.inet.tcp.msl: 15000 -> 1000 <br> <br>Unfortunately, when I try the first command, I get the following error: <br> <br>error: “net.inet.ip.portrange.hifirst” is an unknown key <br> <br>Any clue where am I going wrong? <br> <br>Thanks and regards, <br>Mangesh

Cool :) Will check and revert… Thanks. Appreciate it.