Transforming nginx for Windows

Working on getting real high performance with nginx under windows I am
rewriting code and already got around the fd_setsize issue following

which is documented as http://support.microsoft.com/kb/111855

I came across an interesting issue (FD_SETSIZE compiled for 8196), when
worker_connections is set to 1024 I can get a max of 4500 true
concurrent
connections working, when worker_connections is set to 2048 I can get a
max
of 9000 true concurrent connections working, is there some kind of
recycling
of FD going on inside nginx ? if not I need to look somewhere else.
I intend to also solve the worker_processes issue but I first want to
find
out who is recycling the FD’s.

Posted at Nginx Forum:

On Monday 02 September 2013 00:58:42 itpp2012 wrote:

recycling of FD going on inside nginx ? if not I need to look somewhere
else. I intend to also solve the worker_processes issue but I first want
to find out who is recycling the FD’s.

Yes, there is one. See the ngx_drain_connections() function with
the accompanying ngx_reusable_connection().

wbr, Valentin V. Bartenev

Found them, tnx, no adjustment needed here, it’s dealing with the much
larger FD table without problems. Got up to 12k concurrent connections
today
one worker one cpu at around 40% utilization, can’t get beyond that yet
due
to the test tool not being able to go beyond 12k :slight_smile:

If anyone wants to test as well let me know, I can place the binary
(based
on 1.4.2) somewhere.

Valentin, can you explain what the problem is with multiple workers and
which source files are involved?

Posted at Nginx Forum:

If you want to test along pushing the max concurrent limit here’s my
experimental version:
nginx 1.4.2 experimental b01.zip
http://www.sendspace.com/file/zc4ak8
MD5: 812ea5e77b39a11468291d9cb9b87503
SHA1: a2fb9e89fb272a3b3ee6162667f88e662c591ba6

Got to 20k concurrent connections today, anyone know of a test tool that
can
go beyond 20k concurrent?

Posted at Nginx Forum:

On Sep 10, 2013, at 11:25 PM, itpp2012 [email protected] wrote:

setting the new ones

  • Website created for easy download: http://nginx-win.ecsds.eu/
    Just checking if you have any patches against nginx-1.4 or nginx-1.5 to
    share?

Thanks!

10:27 10-9-2013: B02 build

Based on nginx 1.4.2 with;
pcre-8.32
zlib-1.2.8
openssl-1.0.1e

  • Compiled with: FD_SETSIZE = 16384 (original Windows source files
    modified)
  • Now capable to handle C250K ! (with optimization registry file)
  • Added Windows optimization registry file, check your current values
    BEFORE
    setting the new ones
  • Added debug symbols file (let us know where it went wrong when you
    have a
    crash)
  • Added adjusted nginx(-win).conf for Windows
  • Added SPDY
  • Runs on Windows XP SP3 or higher, both 32 and 64 bit
  • Set priority to High for both nginx.exe processes
  • When nginx is running as a service: My computer → Properties →
    Advanced
    → Performance →
    Advanced → Processor scheduling, Adjust for best performance set to
    background services
  • Website created for easy download: http://nginx-win.ecsds.eu/

Posted at Nginx Forum:

Lua compiled in!

Transforming nginx for Windows:
Transforming nginx for Windows
Redirecting to Google Groups (Lua nginx
compiled
for nginx windows)
Builds can be found here:
http://nginx-win.ecsds.eu/

10:37 23-9-2013: nginx 1.5.6.1 Alice

Based on nginx 1.5.6 (22-9-2013) with;

  • Streaming with nginx-rtmp-module, v1.0.4
    (http://nginx-rtmp.blogspot.nl/)
  • lua-nginx-module v0.8.9 (tnx to agentzh about precompiled headers!)
  • LuaJIT-2.0.2 => (lua51.dll include / lua51.lib build)
  • Added lua51.dll (is required)
  • ngx_devel_kit v0.2.15
  • Additional specifications are like 10:27 10-9-2013: B02 build

Todo:

  • Still working on the multiple worker issue.

Posted at Nginx Forum:

13:46 25-9-2013: nginx 1.5.6.3 Alice

Based on nginx 1.5.6 (25-9-2013) with;

  • Bug fixes in lua-nginx-module(master 25-9-2013) and
    ngx_devel_kit(master
    25-9-2013) by agentzh
  • Both debug and non-debug versions, the non-debug version is production
    use
    ready !

Builds can be found here:
http://nginx-win.ecsds.eu/

Posted at Nginx Forum:

nginxorg Wrote:

Just checking if you have any patches against nginx-1.4 or nginx-1.5
to share?

Thanks!

When the outstanding issues have been resolved all code will flow back
into
the community, my target is a Windows nginx version that can compile,
perform and scale the same as the linux version. I’ve just setup a
budget
for some quality c++ programmers since my c++ knowledge is not enough to
tackle everything. As asked before I would appreciate a technical
explanation why windows issues are what they are as this would speed up
working out a solution.

Posted at Nginx Forum:

Hello!

On Wed, Sep 25, 2013 at 10:43 AM, itpp2012 wrote:

Based on nginx 1.5.6 (25-9-2013) with;

  • Bug fixes in lua-nginx-module(master 25-9-2013) and ngx_devel_kit(master
    25-9-2013) by agentzh

First of all, thank you for the work on Windows! :slight_smile:

It’ll be great if you can try running ngx_lua (and other nginx
modules’) test suite against your Windows build on Windows. The test
scaffold is written in Perl which may run on Windows out of the box
:slight_smile:

Thanks!
-agentzh

Hello!

On Wed, Sep 25, 2013 at 2:02 PM, itpp2012 wrote:

Url of this scaffold? I can get anything running so this is going to be an
interesting test.

See the official documentation for the ngx_lua test suite:

http://wiki.nginx.org/HttpLuaModule#Test_Suite

Good luck!
-agentzh

First of all, thank you for the work on Windows! :slight_smile:

We’re getting there slowly! :slight_smile: I’ve got 2 workers working, just need to
figure out why :slight_smile:

It’ll be great if you can try running ngx_lua (and other nginx
modules’) test suite against your Windows build on Windows. The test
scaffold is written in Perl which may run on Windows out of the box

Url of this scaffold? I can get anything running so this is going to be
an
interesting test.

Posted at Nginx Forum:

This is very nice. Thanks. I noticed the
encrypted-session-nginx-module is
missing from this build. Is there some reason you omitted it? Have you
published any docs on how to build this ourselves in windows using your
source code? Or is that obvious and I should RTM?

Posted at Nginx Forum:

How ready is this for production? I seem to be getting a lot of
intermittent timeouts/dropped connections to the backend or something
doing
upstream proxying. Just wondering before I go digging into this any
more.

Posted at Nginx Forum:

tonyschwartz Wrote:

This is very nice. Thanks. I noticed the
encrypted-session-nginx-module is missing from this build. Is there

No reason to omit it other then no one has requested it :slight_smile: I’ll have a
look
and add it if there are no cross source/module conflicts for the next
release, at the moment we’re busy with integrating a select-boost api in
the
core.

some reason you omitted it? Have you published any docs on how to
build this ourselves in windows using your source code? Or is that
obvious and I should RTM?

A Rtfm is always recommended :wink:

Posted at Nginx Forum:

tonyschwartz Wrote:

How ready is this for production? I seem to be getting a lot of
intermittent timeouts/dropped connections to the backend or something
doing upstream proxying. Just wondering before I go digging into this
any more.

It is ready for production use and it used in production servers, just
keep
an eye out for Beta’s which offer solutions to many other problems as we
go
along redeveloping. Problems with backends are common and mostly not
related
to nginx as nginx just passes to a backend, anything can go wrong while
talking to a backend.

Posted at Nginx Forum:

Actually, this may be my issue:

Posted at Nginx Forum:

tonyschwartz Wrote:

There is definitely some issue doing proxying. At some point, the
connection to the back end appears to go bad. The request from the
browser to nginx just spins and spins. This occurs against (ahem…)
IIS6 and also against the Cassini local visual studio development

99% sure this is a backend issue, we’re using it for proxied IIS5/6/7,
tomcat, java. Fcgi’d php and RoR. The WAF (naxsi) for protecting
internet
facing applications, plenty of Lua code provisioning, Lua scaled backend
load-balancing, authentication, etc…

Posted at Nginx Forum:

There is definitely some issue doing proxying. At some point, the
connection to the back end appears to go bad. The request from the
browser
to nginx just spins and spins. This occurs against (ahem…) IIS6 and
also
against the Cassini local visual studio development environment exhibits
this behavior. I will try this from a linux host to see if I can
reproduce
the issue there. The issue I’m experiencing seems to be very much the
same
as in the other topic I referenced above.

Posted at Nginx Forum:

Hello!

On Thu, Mar 06, 2014 at 06:05:03PM -0500, tonyschwartz wrote:

There is definitely some issue doing proxying. At some point, the
connection to the back end appears to go bad. The request from the browser
to nginx just spins and spins. This occurs against (ahem…) IIS6 and also
against the Cassini local visual studio development environment exhibits
this behavior. I will try this from a linux host to see if I can reproduce
the issue there. The issue I’m experiencing seems to be very much the same
as in the other topic I referenced above.

The issue in a topic you’ve referenced is wrong address used in
proxying. See #496 (Windows upstream 60 proxy_pass timeout) – nginx for detailed
explanation.


Maxim D.
http://nginx.org/