# Perceived poor performance

**URL:** <https://www.ruby-forum.com/t/perceived-poor-performance/225525>\
**Category:** NGINX\
**Created:** [January 13, 2013, 6:53am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525 "2013-01-13T06:53:33Z")\
**Posts on this page:** 5\
**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:** [January 13, 2013, 6:53am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525/1 "2013-01-13T06:53:33Z")

</div>

I don’t know if this actually IS poor performance - it just feels like  
it.

I’m running nginx and php-fpm on a VirtualBox virtual server. No other  
services are running (other than the standard Ubuntu Precise minor items  
for a server). The VM has four cores and 1G allocated.

Any time I connect to my server it seems to take 3 seconds before the  
request is processed. I’ve seen some references via Google that  
indicate this is TCP related - but I don’t know where to look to find  
the break.

## The second item - which is probably meaningless until the 3 second delay is resolved - is stress tests from an external server (I’m trying [http://loader.io](http://loader.io)) start dropping connections after about 30 simultaneous connections. From what little I’ve gathered about nginx performance this is absurd.

Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_LSMiller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c4cdca/32.png) [@Daniel\_LSMiller](https://www.ruby-forum.com/u/Daniel_LSMiller)\
**Post date:** [January 14, 2013, 12:20am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525/2 "2013-01-14T00:20:56Z")

</div>

On 1/12/2013 9:52 PM, Daniel L. Miller wrote:

> the break.  
> Further tests show me it isn’t for all requests - only requests to my  
> Wordpress sites, which have a much more complex nginx configuration that  
> other sites which give me instantaneous response. What (improper)  
> commands would have such a major slowdown effect?  
> –  
> Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_LSMiller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c4cdca/32.png) [@Daniel\_LSMiller](https://www.ruby-forum.com/u/Daniel_LSMiller)\
**Post date:** [January 14, 2013, 12:31am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525/3 "2013-01-14T00:31:27Z")

</div>

On 13/01/13 19:17, Daniel L. Miller wrote:

> > indicate this is TCP related - but I don’t know where to look to find  
> > the break.  
> > Further tests show me it isn’t for all requests - only requests to my  
> > Wordpress sites, which have a much more complex nginx configuration  
> > that other sites which give me instantaneous response. What  
> > (improper) commands would have such a major slowdown effect?  
> > a wp config isn’t particularly complex.

What database tuning have you done (are the fast ones also using a  
database)? yes I know it’s remote, but…  
What memory are you allocating to the server?  
How busy is the physical server?  
Are you running a local DNS server?

Sorry I’m not versed in VB, but I run plenty of WP sites off KVM  
servers.

---

<div class="post-metadata">

**Author:** ![Daniel\_LSMiller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c4cdca/32.png) [@Daniel\_LSMiller](https://www.ruby-forum.com/u/Daniel_LSMiller)\
**Post date:** [January 14, 2013, 12:48am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525/4 "2013-01-14T00:48:24Z")

</div>

On 1/12/2013 10:28 PM, Steve H. wrote:

> > > the request is processed. I’ve seen some references via Google that  
> > > What memory are you allocating to the server?  
> > > How busy is the physical server?  
> > > Are you running a local DNS server?
> 
> Sorry I’m not versed in VB, but I run plenty of WP sites off KVM servers.

The fast ones are using the same Mysql database. I’ve done a little bit  
of Mysql tweaking - I periodically run mysqltuner - but I truly don’t  
think that’s the issue.

I’ve got 1G of RAM allocated to the VM. The physical server has 16G.

The physical server is a 6-core Opteron. Under “load” - neither the  
host nor the guest show much usage.

I am running a local DNS server (PowerDNS).

While I’ve already admitted my overall ignorance - I truly don’t think  
it’s anything else. I’ve probably munged my nginx wordpress config - I  
just don’t know HOW! Getting wordpress multi-site running was quite a  
frustration. I may try to rebuild my config.

One of my issues is I may have tried to be too “elegant” - I like using  
multiple include files to try to avoid duplication. That way multiple  
configs can share common setups. I may have broken the config by  
breaking things up too far! And I don’t know if combining fast-cgi  
caching with W3 Total Cache is helping or hurting (assuming of course  
I’m doing it correctly).

## For me, the whole “rewrite” process, particularly the combination of Wordpress’ logic and nginx syntax, has me quite confused.

Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_LSMiller](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c4cdca/32.png) [@Daniel\_LSMiller](https://www.ruby-forum.com/u/Daniel_LSMiller)\
**Post date:** [January 14, 2013, 1:20am UTC](https://www.ruby-forum.com/t/perceived-poor-performance/225525/5 "2013-01-14T01:20:36Z")

</div>

On 01/13/2013 07:17 AM, Daniel L. Miller wrote:  
[snip]

> Further tests show me it isn’t for all requests - only requests to my  
> Wordpress sites, which have a much more complex nginx configuration that  
> other sites which give me instantaneous response. What (improper)  
> commands would have such a major slowdown effect?

For my Wordpress site I installed nginx-helper in Wordpress:

> **[Nginx Helper](https://wordpress.org/plugins/nginx-helper/)**
>
> Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also does a few more things.

And added the cache config inspired by these 2 pages:

> **[Tutorials](https://easyengine.io/tutorials/)**
>
> Nginx, WordPress, AWS, Letsencrypt, load balancer, memory limit and many more troubleshooting and setup information.

[http://codex.wordpress.org/Nginx](http://codex.wordpress.org/Nginx)

And the Wordpress site became much faster. You do need to build nginx  
with the ngx\_cache\_purge module from:

> **[GitHub - FRiCKLE/ngx\_cache\_purge: nginx module which adds ability to purge content...](https://github.com/FRiCKLE/ngx_cache_purge)**
>
> nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.

Wordpress multi-site info here:

> **[Tutorials](https://easyengine.io/tutorials/)**
>
> Nginx, WordPress, AWS, Letsencrypt, load balancer, memory limit and many more troubleshooting and setup information.

> **[Tutorials](https://easyengine.io/tutorials/)**
>
> Nginx, WordPress, AWS, Letsencrypt, load balancer, memory limit and many more troubleshooting and setup information.

Check the source of the generated pages. It shows some info how long it  
took to generate the page.

You may also want to look at your DB and optimize where possible.

Regards,  
Patrick
