The results (http://pastebin.com/R5RdeZYC) give a winning Apache, who
was born to do this, but the most significant thing is that under
"heavy" load NodeJS refuses connections! I think I made something
wrong.
All my test with latest NodeJS (0.1.32) on Ubuntu 9.04, tested with
the following command:ab -n 100000 -c 1000 http://127.0.0.1:8080/var/www/index.html
How can I do to ensure that all requests are resolved properly?
Thnak you,
Ivano
You're loading the file for each request, which Apache certainly isn't
doing. Not that I expect Node to be faster than Apache, but it's a bit
unfair example.
> All my test with latest NodeJS (0.1.32) on Ubuntu 9.04, tested with
> the following command:ab -n 100000 -c 1000 http://127.0.0.1:8080/var/www/index.html
>
> How can I do to ensure that all requests are resolved properly?
It's difficult to say what's happening. One obvious thing comes to
mind: you should check your ulimit -n to see that Node can have enough
file descriptors open. You also ought to check that it's actually Node
refusing connections and not just ab running out of open ports. (Can
you curl the server from a different host?)
I think Apache does almost the same thing,since you can see any
changes in your browser as soon as your file is saved.
However, I test Node with a LRU Cache on contents (without
expiration). This is my pseudo-optimized script: http://pastebin.com/3b7ara5Q
Node results are still far from Apache: 1627.07 rps without Cache,
2139.50 rps with Cache, 3425.83 rps with Apache2, 5896.23 rps with
NGINX (same ab -n 100000 -c 1000 http://127.0.0.1:$PORT/index.html
command). I run my benchs on a single core machine.
Do you have any other ideas to boost performance?
> It's difficult to say what's happening. One obvious thing comes to
> mind: you should check your ulimit -n to see that Node can have enough
> file descriptors open. You also ought to check that it's actually Node
> refusing connections and not just ab running out of open ports. (Can
> you curl the server from a different host?)
You are right, I was stuck on defaults settings (1024). Previous
results are obtain with these:
# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 999999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Thank you very much,
Ivano
just to point out other benchmarks results I got, while NodeJS doesn't
perform well against legacy http servers like Apache or Nginx, it is
really faster than Jaxer (using jaxer-service on Apache running 10
workers): 1204.82 rps vs 53.71 rps.
Great!
bye,
Ivano
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
Apache stats the file to see if it's changed since last time it was
sent, and sends it from memory if possible, whereas you've got node
doing an open()/read()/close() on every request.
So, yeah, it's a bit of an unfair example. Do the same thing in node,
and it's a bit fairer test.
Ryan: you should expect node to be faster. It is, and it has been for
many versions now. At least, it is on my machine, and that's an
Apache instance with hardly any modules enabled.
Also, you should be using nginx to serve static files, and have it
proxy to node for programmy bits. nginx is faster than lightening on
crack.
--i
> I think Apache does almost the same thing,since you can see any
> changes in your browser as soon as your file is saved.
Never ever ever ever use a browser to test your http server. Browsers
are for testing html and css and browser-JS. Just because Apache
shows changes "right away" doesn't mean it isn't caching the data. It
just means that modifying the file invalidates the cache.
Use curl for testing http. Use browsers for testing html.
--i
--i
>
> Never ever ever ever use a browser to test your http server. Browsers
> are for testing html and css and browser-JS. Just because Apache
> shows changes "right away" doesn't mean it isn't caching the data. It
> just means that modifying the file invalidates the cache.
>
> Use curl for testing http. Use browsers for testing html.
>
> --i
I don't use browser to test my http server, i tried to explain the
behaviour. In my second test used a LRU cache to store content from
file. So, i read the file in the first round only, the rest come from
cache.
Anyway, thanks again for your support.
Ivano
You should probably compare a node web service to other similar
platforms. For instance a python wsgi app. Nginx and Apache are much
faster than a node app, but come with the cost of very expensive
development.
1000 rps sounds way too low, however.
>
> Great!
>
> bye,
> Ivano
>
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>
--
Rasmus Andersson
I also known that the results variance for each 8 cycle per test is
much smaller than with Apache, this seems to me very positive because
loads is more predictable, enabling better infrastructure planning.
Thank you very much,
Ivano
On 17 Mar, 20:27, Isaac Schlueter <i...@izs.me> wrote: