logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: Node.js reverse proxy => Apache win
Author
Kanashii



Joined: 17 Jul 2006
Posts: 155
Location: Porando

PostPosted: Mon 11 Jul '11 22:47    Post subject: Node.js reverse proxy => Apache win Reply with quote

My first open source project: reverse.proxy-at-node.js

https://github.com/dawjan/reverse.proxy-at-node.js

Now its only possible to use with cygwin but i think next month will be relase native nodejs for windows


Now in beta so try test with: ab.exe and compare results Smile
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Thu 14 Jul '11 20:56    Post subject: Reply with quote

Is this to have node js instead of apache as reverse proxy? Please post an example config or setup. I wanna know how to use it.
Back to top
Kanashii



Joined: 17 Jul 2006
Posts: 155
Location: Porando

PostPosted: Fri 15 Jul '11 21:51    Post subject: Reply with quote

For now i use only that for static content eq cdn.hostename.com

http://nodejs.org/dist/v0.5.1/node.exe

Its relase first relase of nodejs for windows

nodejs.exe scriptname.js


[Rev proxy adres ]
proxy_ip = '127.0.0.1';
proxy_port = 80;

[Apache server] - no proxy etc only simple server
httpd_ip = '127.0.0.1';
httpd_port = 81;

Its still i beta there are no Nodejs native and now run on cygwin every one day 80% usage. Maybe next month will be release native nodejs.exe

For PHP can only handle on cygwin 40 connction per second but when is content cached is blazing speed

in code you had:

if( path.match(/.js|.css|.xml|.ico|.png|.jpeg|.jpg/) ) {
return true;
}

so add index.php or something else ale will be cache in node memory

I use also http://www.iqproxyserver.com/reverseproxy.php
Back to top
Kanashii



Joined: 17 Jul 2006
Posts: 155
Location: Porando

PostPosted: Sat 16 Jul '11 1:26    Post subject: Reply with quote

First bench on static images, but its first release of node for windows.
Need time maybe i change cache engine.
When i use old version on cygwin on static page it load all content ~50ms faster.

UPDATE
On node for windows the child_process is not support jet. So need time: https://github.com/joyent/node/blob/master/TODO.win32

Can somebody benchmark on Linux


[Node.js with cache]
Quote:

Server Hostname: 127.0.0.1
Server Port: 81

Document Length: 134444 bytes

Concurrency Level: 200
Time taken for tests: 5.766 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 134687000 bytes
HTML transferred: 134444000 bytes
Requests per second: 173.44 [#/sec] (mean)
Time per request: 1153.125 [ms] (mean)
Time per request: 5.766 [ms] (mean, across all concurrent requests)
Transfer rate: 22812.84 [Kbytes/sec] received


[Node.js cygwin use 100% CPU]
Quote:

Document Length: 134444 bytes

Concurrency Level: 200
Time taken for tests: 130.922 seconds
Complete requests: 1000
Failed requests: 863
(Connect: 0, Receive: 0, Length: 863, Exceptions: 0)
Write errors: 0
Total transferred: 8064185685 bytes
HTML transferred: 8063953863 bytes
Requests per second: 7.64 [#/sec] (mean)
Time per request: 26184.375 [ms] (mean)
Time per request: 130.922 [ms] (mean, across all concurrent requests)
Transfer rate: 60151.76 [Kbytes/sec] received


[Apache]
Quote:

Document Length: 134444 bytes

Concurrency Level: 200
Time taken for tests: 4.078 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 134681000 bytes
HTML transferred: 134444000 bytes
Requests per second: 245.21 [#/sec] (mean)
Time per request: 815.625 [ms] (mean)
Time per request: 4.078 [ms] (mean, across all concurrent requests)
Transfer rate: 32251.20 [Kbytes/sec] received
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 16 Jul '11 19:43    Post subject: Reply with quote

Did you ever thought of using apache as reverse proxy? Tried?

Offtopic: Are you a japan fan? Kanashii seems to me a japanese name. And I think Porando is japanese for Poland?
Back to top
Kanashii



Joined: 17 Jul 2006
Posts: 155
Location: Porando

PostPosted: Sat 16 Jul '11 23:27    Post subject: Reply with quote

That whose long time ego now i think more about Asja Smile
Correct Kanashii - sorrow, and Porando like Engrish
But lot of people when i say im from Poland think Holand

About performance:
Apache windows ab.exe big test static content CPU usage 80%
No caching "jet" for headers
drop support for memcaching

nginx had some big issue and cant use in production
Windows server are faster but not like g-wan
G-wan - nice webserver but drop support for windows when apache Cpu usage 80% G-wan 2%
I looking for something fast and now node is pretend to act like fast webserver.
Compare Apache win to Linux is weary poor performance but working

Now i looking for something to run faster PHP

http://php.net/manual/en/features.commandline.webserver.php
or PHP appserver [ Linux only ]
Back to top


Reply to topic   Topic: Node.js reverse proxy => Apache win View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner