# Nginx windows + apache backend: slow php files in nginx

**URL:** <https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730>\
**Category:** NGINX\
**Created:** [December 10, 2011, 8:58pm UTC](https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730 "2011-12-10T20:58:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 10, 2011, 8:58pm UTC](https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730/1 "2011-12-10T20:58:20Z")

</div>

Hi there,

I started to test nginx windows + apache/php backend on a Win7 x64  
machine.

I haven’t discovered why this happenning:

Test 1 - ab -n 300 -c 20 [http://127.0.0.1](http://127.0.0.1):80/hello.php (nginx  
listen port 80)  
Requests per second: 106.66 [#/sec] (mean)

Test 2 - ab -n 300 -c 20 [http://127.0.0.1](http://127.0.0.1):8080/hello.php  
(apache+mod\_php listen port 8080)  
Requests per second: 967.69 [#/sec] (mean)

My conf file:  
location / {

```
      ## Apache / PHP

      proxy_pass http://127.0.0.1:8080;
      proxy_redirect off;
      proxy_set_header Host $host;
      ## For GEOIP + RPAF (apache modules)
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For

```

$proxy\_add\_x\_forwarded\_for;  
client\_max\_body\_size 2m;  
client\_body\_buffer\_size 1024k;  
proxy\_connect\_timeout 90;  
proxy\_send\_timeout 90;  
proxy\_read\_timeout 90;  
proxy\_buffering on;  
proxy\_buffers 513 32k;  
proxy\_buffer\_size 16m;  
proxy\_busy\_buffers\_size 16m;  
}

Any thoughts about why Apache gives 10x the speed of Nginx?

Thanks  
Ricardo

Posted at Nginx Forum:

> **[nginx windows + apache backend: slow php files in nginx](https://forum.nginx.org/read.php?2,219861,219861#msg-219861)**
>
> Hi there, I started to test nginx windows + apache/php backend on a Win7 x64 machine. I haven't discovered why this happenning: Test 1 - ab -n 300 -c 20 http://127.0.0.1:\[b\]80\[/b\]/hello.php (nginx listen port 80) Requests per second: \[b\]106.66

---

<div class="post-metadata">

**Author:** ![ricardok1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c6cbf5/32.png) [@ricardok1](https://www.ruby-forum.com/u/ricardok1)\
**Post date:** [December 11, 2011, 5:04am UTC](https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730/2 "2011-12-11T05:04:44Z")

</div>

This might apply to you:

> **[nginx Window native](https://forum.nginx.org/read.php?2,219822,219822#msg-219822)**
>
> Hello, Going through nginx/Windows usage http://nginx.org/en/docs/windows.html I see that there are some important limitations: Known issues - Although several workers can be run, only one of them actually does any work. - A worker ca

Posted at Nginx Forum:

> **[Re: nginx windows + apache backend: slow php files in nginx](https://forum.nginx.org/read.php?2,219861,219864#msg-219864)**
>
> Hi there, I started to test nginx windows + apache/php backend on a Win7 x64 machine. I haven't discovered why this happenning: Test 1 - ab -n 300 -c 20 http://127.0.0.1:\[b\]80\[/b\]/hello.php (nginx listen port 80) Requests per second: \[b\]106.66

---

<div class="post-metadata">

**Author:** ![ricardok1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c6cbf5/32.png) [@ricardok1](https://www.ruby-forum.com/u/ricardok1)\
**Post date:** [December 11, 2011, 10:22am UTC](https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730/3 "2011-12-11T10:22:39Z")

</div>

Thanks Martin (Ensiferous).

So you think that the lack of porting some features gives this strange  
result on Windows to proxy to Apache? Cache maybe.

The benchmark to serve static files is not affected as much (less 10%  
only).

Do you have suggestions?

Thanks  
Ricardo

Posted at Nginx Forum:

> **[Re: nginx windows + apache backend: slow php files in nginx](https://forum.nginx.org/read.php?2,219861,219866#msg-219866)**
>
> Hi there, I started to test nginx windows + apache/php backend on a Win7 x64 machine. I haven't discovered why this happenning: Test 1 - ab -n 300 -c 20 http://127.0.0.1:\[b\]80\[/b\]/hello.php (nginx listen port 80) Requests per second: \[b\]106.66

---

<div class="post-metadata">

**Author:** ![ricardok1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c6cbf5/32.png) [@ricardok1](https://www.ruby-forum.com/u/ricardok1)\
**Post date:** [December 17, 2011, 12:04am UTC](https://www.ruby-forum.com/t/nginx-windows-apache-backend-slow-php-files-in-nginx/214730/4 "2011-12-17T00:04:11Z")

</div>

Anybody can give an hint?

Posted at Nginx Forum:

> **[Re: nginx windows + apache backend: slow php files in nginx](https://forum.nginx.org/read.php?2,219861,220187#msg-220187)**
>
> Hi there, I started to test nginx windows + apache/php backend on a Win7 x64 machine. I haven't discovered why this happenning: Test 1 - ab -n 300 -c 20 http://127.0.0.1:\[b\]80\[/b\]/hello.php (nginx listen port 80) Requests per second: \[b\]106.66
