# Nginx, PHP, Wordpress, VirtualBox

**URL:** <https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553>\
**Category:** NGINX\
**Created:** [January 11, 2013, 12:41am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553 "2013-01-11T00:41:20Z")\
**Posts on this page:** 7\
**Page:** 1

<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 11, 2013, 12:41am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/1 "2013-01-11T00:41:20Z")

</div>

Dunno if anyone’s running anything similar. I recently shifted to Nginx  
from Cherokee - and in so doing I setup a virtual server using  
VirtualBox to run it in. My primary use is for serving a pair of  
Wordpress sites.

This is not (currently) a high-traffic server - but I do want it to run  
well regardless. My current configuration for the virtual hardware is 1  
CPU and 1G RAM. Nginx (obviously) is installed, as is php-fpm. Mysql  
is running on the host - both host & guest are Ubuntu.

Generally, of that 1G I see half in-use, a quarter cached, and a quarter  
free. So my first reaction is I don’t THINK I’m starving the VM for RAM

- but maybe I’m missing something.

I generally don’t seeing anything actively running except for php during  
a request - which hits 25% usage.

## Any suggestions for modifying my virtual or nginx config? Or do I need to focus on Wordpress caching?

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 11, 2013, 12:50am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/2 "2013-01-11T00:50:06Z")

</div>

On Thu, 2013-01-10 at 15:40 -0800, Daniel L. Miller wrote:

> Generally, of that 1G I see half in-use, a quarter cached, and a quarter  
> free. So my first reaction is I don’t THINK I’m starving the VM for RAM
> 
> - but maybe I’m missing something.
> 
> I generally don’t seeing anything actively running except for php during  
> a request - which hits 25% usage.
> 
> Any suggestions for modifying my virtual or nginx config? Or do I need  
> to focus on Wordpress caching?

You don’t say what the problem is, but if it’s performance, look at:

1. Host database config
2. PHP config - memory use
3. Add an opcode cacher - APC seems to work best on php-fpm
4. Nginx config - compression, expiry headers, fpm resources.

TBH I feel that WP caching options are for those without the ability to  
to the job properly - ie cannot tune their servers.

…but it all sounds ok to me TBH. I run pure nginx servers on KVM VPSes  
with 128MB - and they only use half of that.

hth,

Steve

---

<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 11, 2013, 2:05am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/3 "2013-01-11T02:05:02Z")

</div>

On 1/10/2013 3:49 PM, Steve H. wrote:

> >

LOL - you’re right! I didn’t mention what my problem might be!

Yes, it was a performance concern. My site’s rather small - basically a  
corporate vanity site - and I haven’t been slashdotted yet…so I don’t  
think it’s a huge issue now…

It just “felt” like it was running slow. I did just switch from xcache  
to apc - and also adjusted the apc settings to where they might do some  
good.

## I also just realized that many of my caching options get invalidated when I access the site as a logged-in admin. That all by itself makes a HUGE difference!

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 11, 2013, 10:05am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/4 "2013-01-11T10:05:09Z")

</div>

> On 1/10/2013 3:49 PM, Steve H. wrote:
> 
> > You don’t say what the problem is, but if it’s performance, look at:
> > 
> > 1. Host database config
> > 2. PHP config - memory use
> > 3. Add an opcode cacher - APC seems to work best on php-fpm
> > 4. Nginx config - compression, expiry headers, fpm resources.
> > 
> > TBH I feel that WP caching options are for those without the ability to  
> > to the job properly - ie cannot tune their servers.

Not sure what you are referring to here. The premise is that caching for  
WordPress is a must:

I am running a WordPress site with nginx, php-fpm, and APC on a low  
performance machine with two cores. Without caching, it is able to serve  
about 5 page requests per second. At this request rate, php-fpm  
constantly produces 100 % CPU load on both cores. The take-home message  
is that WordPress is bloated and requires its resources. Maybe this is  
still tunable in order to increase performance by a few or even 100  
percent. But this is not worth the effort, because with enabled nginx  
fastcgi\_cache the server easily answers thousands of requests per  
second, i.e. exhibits several orders of magnitude more performance.

Some people are using a caching plugin for WordPress itself – which is  
a good solution when using a shared hosting platform without the chance  
to change the web stack or change the web server configuration.

Others implement caching below the web application level as I did. This  
is a cleaner and probably faster solution. In any case, caching for  
WordPress is a must.

Cheers,

Jan-Philip

---

<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 11, 2013, 10:32am UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/5 "2013-01-11T10:32:02Z")

</div>

On 11/01/13 22:04, Jan-Philip Gehrcke wrote:

> enabled nginx fastcgi\_cache the server easily answers thousands of
> 
> Cheers,
> 
> Jan-Philip  
> So you agree with me then…

---

<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 11, 2013, 6:50pm UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/6 "2013-01-11T18:50:33Z")

</div>

On 1/10/2013 3:49 PM, Steve H. wrote:

> …but it all sounds ok to me TBH. I run pure nginx servers on KVM VPSes  
> with 128MB - and they only use half of that.

## Do you have php or other services running on other VM’s than the ngninx servers with such minimum settings?

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 11, 2013, 7:44pm UTC](https://www.ruby-forum.com/t/nginx-php-wordpress-virtualbox/229553/7 "2013-01-11T19:44:18Z")

</div>

On 12/01/2013, at 6:49 AM, “Daniel L. Miller” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> [mailman.nginx.org archive](http://mailman.nginx.org/mailman/listinfo/nginx)  
> Yes, they were running on the physical server.

Steve
