alexandrejbr / WebFrameworksBenchmarks

Web frameworks benchmarks
2 stars 1 forks source link

clojure http-kit version not using all CPU power #4

Open alexandrejbr opened 10 years ago

alexandrejbr commented 10 years ago

Clojure http-kit version is not using all CPU power on ubuntu 14.04 LTS (i don't think the problem is on the OS but I mentioned it anyway).

In my quad-core it reaches an average of ~70% virtual core (8 virtual cores) usage.

Other versions use almost all CPU power. Node.js uses nearly 100% in all virtual cores, and other versions like play and spray use ~97% in all virtual cores.

I think there may be a problem on clojure http-kit version of the test.

hiddenbyte commented 10 years ago

This might be because of the 'thread' parameter of http-kit server. This indicates the number of "threads to compute response from request", http-kit defaults to 4 when the parameter is not set.

A commit - 01eb5d7ea830667f9b3f938eeaa55e6591b13f7b - was made to set the 'thread' parameter with the value returned from 'Runtime.getRuntime().availableProcessors()' http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#availableProcessors%28%29.

This might 'solve' this issue.

alexandrejbr commented 10 years ago

Now it's worse:

Can you reproduce this behavior in your machine?

hiddenbyte commented 10 years ago

How many threads "to compute" were printed when executed ?

alexandrejbr commented 10 years ago

8