# Help me test and verify my config

**URL:** <https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889>\
**Category:** NGINX\
**Created:** [June 24, 2012, 2:24am UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889 "2012-06-24T02:24:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 24, 2012, 2:24am UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/1 "2012-06-24T02:24:03Z")

</div>

Nginx community, i’ve recently switched to this awesome software which  
has performed admirably under load testing.

I host a php/mysql driven site that with each page view serves results  
from multiple external xml feeds in realtime. Once we have the XML data  
we cache results to reduce load.

I run nginx / php5-fpm / memcache and APC. Site gets \> 100,000 searches  
per day. Each query takes between 1 and 4 seconds depending on the  
search. So as you can imagine the processes don’t open and close as  
quickly as some more basic php sites. Server load is around 3 average  
for a quad core box. So OK…

But i wanted your expert opinion on how to check, test and verify my  
config params for nginx and php5-fpm. I want to be 100% sure i haven’t  
allocated too many processes. So without pasting my entire config, i  
will show just the bits i’m concerned i wish to check with you guys.

php5-fpm tweaks  
Concerns - is max\_children / start servers too high? Would they take up  
CPU processes wasting resources?  
pm = dynamic  
pm.max\_children = 30  
pm.start\_servers = 15  
pm.min\_spare\_servers = 5  
pm.max\_spare\_servers = 30  
pm.max\_requests = 511  
listen.backlog = 1024

Worker\_processes 4  
worker\_connections 8192

fastcgi\_params  
Concerns - is my fastcgi\_buffers too much? The reason why i set them  
high is that each XML result can contain a lot of data.  
fastcgi\_connect\_timeout 60;  
fastcgi\_send\_timeout 180;  
fastcgi\_read\_timeout 180;  
fastcgi\_buffer\_size 128k;  
fastcgi\_buffers 256 16k;  
fastcgi\_busy\_buffers\_size 256k;  
fastcgi\_temp\_file\_write\_size 256k;

Even under load, memory usage only reaches about 45% so perhaps i’m  
wasting an opportunity to cache more things in memory.

Thank you

Posted at Nginx Forum:

> **[Help me test and verify my config](https://forum.nginx.org/read.php?2,227820,227820#msg-227820)**
>
> Nginx community, i've recently switched to this awesome software which has performed admirably under load testing. I host a php/mysql driven site that with each page view serves results from multiple external xml feeds in realtime. Once we have the...

---

<div class="post-metadata">

**Author:** ![bp1000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bp1000](https://www.ruby-forum.com/u/bp1000)\
**Post date:** [June 24, 2012, 8:50am UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/2 "2012-06-24T08:50:08Z")

</div>

Ok,  
so what is your question?  
thanks,  
mike

On Sun, Jun 24, 2012 at 12:23 AM, bp1000 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> quickly as some more basic php sites. Server load is around 3 average  
> CPU processes wasting resources?  
> worker\_connections 8192  
> fastcgi\_busy\_buffers\_size 256k;
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)

–  
James Michael DuPont  
Member of Free Libre Open Source Software Kosova [http://flossk.org](http://flossk.org)  
Contributor FOSM, the CC-BY-SA map of the world [http://fosm.org](http://fosm.org)  
Mozilla Rep [https://reps.mozilla.org/u/h4ck3rm1k3](https://reps.mozilla.org/u/h4ck3rm1k3)

---

<div class="post-metadata">

**Author:** ![bp1000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bp1000](https://www.ruby-forum.com/u/bp1000)\
**Post date:** [June 25, 2012, 6:21am UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/3 "2012-06-25T06:21:02Z")

</div>

The question is buried inside the details. It’s, I guess, this:

“But i wanted your expert opinion on how to check, test and verify my  
config params for nginx and php5-fpm. I want to be 100% sure i haven’t  
allocated too many processes.”

Openly yours,  
Shankar Dhanasekaran

---

<div class="post-metadata">

**Author:** ![bp1000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bp1000](https://www.ruby-forum.com/u/bp1000)\
**Post date:** [June 26, 2012, 6:34pm UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/4 "2012-06-26T18:34:39Z")

</div>

Yes, i just wanted an expert opinion on verifying my parameters

I felt it necessary to explain the application, environment and  
parameters.

Just as a follow up; i found that the pm = dynamic config i was using  
whilst serving OK for visitor, it seemed to be using twice the  
processing that a pm = static used up.

So i have switched to an entirely static allocation.

I projected that each child process consumes about 50Mb with overheads  
and therefore allocated 40 child processes for php5-fpm

So far so good.

I’m still getting connection reset by peer but i’m 99% sure this is  
people who click back or stop the load before the page finishes. As we  
get over 100k searches per day, 10-15 connection reset by peer errors  
are fine.

The only thing is, only 50% of my memory is being used so maybe i can  
allocate more somewhere.

Posted at Nginx Forum:

> **[Re: Help me test and verify my config](https://forum.nginx.org/read.php?2,227820,227943#msg-227943)**
>
> Nginx community, i've recently switched to this awesome software which has performed admirably under load testing. I host a php/mysql driven site that with each page view serves results from multiple external xml feeds in realtime. Once we have the...

---

<div class="post-metadata">

**Author:** ![bp1000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bp1000](https://www.ruby-forum.com/u/bp1000)\
**Post date:** [June 26, 2012, 9:44pm UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/5 "2012-06-26T21:44:37Z")

</div>

may i suggest [How To Ask Questions The Smart Way](http://www.catb.org/~esr/faqs/smart-questions.html)

On Tue, Jun 26, 2012 at 4:34 PM, bp1000 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So i have switched to an entirely static allocation.  
> are fine.  
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)  
> –  
> James Michael DuPont  
> Member of Free Libre Open Source Software Kosova [http://flossk.org](http://flossk.org)  
> Contributor FOSM, the CC-BY-SA map of the world [http://fosm.org](http://fosm.org)  
> Mozilla Rep [https://reps.mozilla.org/u/h4ck3rm1k3](https://reps.mozilla.org/u/h4ck3rm1k3)

---

<div class="post-metadata">

**Author:** ![bp1000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/87869e/32.png) [@bp1000](https://www.ruby-forum.com/u/bp1000)\
**Post date:** [June 27, 2012, 4:19pm UTC](https://www.ruby-forum.com/t/help-me-test-and-verify-my-config/220889/6 "2012-06-27T16:19:58Z")

</div>

Mike, sure

I thought my post title was very clear; couldn’t have been any clearer.

I guess i may as well have posted a dancing cat purely for entertainment  
value.

Perhaps my post wasn’t that clear then. Fair enough. I had searched and  
clawed over tonnes of information. In fact i spent quite a few hours  
looking. However, it seems not 1 set of parameters is suitable for every  
nginx + php5-fpm set up, which is sensible really. I’m not a natural  
sysadmin and as it was the weekend my sysadmin was unavailable, probably  
off geocaching or something.

What i couldn’t find is enough info on how to test and verify my chosen  
config. Due to the volume of traffic and revenue involved i didnt want  
it to be trial and error. I also wanted an expert eye cast over the  
chosen params in case anything jumped out as obviously incorrect.

Posted at Nginx Forum:

> **[Re: Help me test and verify my config](https://forum.nginx.org/read.php?2,227820,227998#msg-227998)**
>
> Nginx community, i've recently switched to this awesome software which has performed admirably under load testing. I host a php/mysql driven site that with each page view serves results from multiple external xml feeds in realtime. Once we have the...
