microservices-framework-benchmark
microservices-framework-benchmark copied to clipboard
Fine tuning of JEE servers
Hi,
I would like to point out, that some parts of the benchmark are not really accurate, since they use default app server configs. So Wildfly & Payara are using by default only 5 threads to serve any servlet (in the example JAX-RS). Increasing the thread number & ejb pool may greatly increase these app server's throughput. (I think the same would apply to Spring boot benchmarks). Conclusion: please make a benchmark with fine tuned app servers to show the real capabilities of the given tech stack.
Also: in the light-java to my understanding, it is using servlet technology as-is, while JAX-RS adds a much heavier layer on the servlets (like parsing the incoming requests to DTOs and vice-versa or handling http requests based on the headers). Conclusion: it would be good to see a simple code on top of a JEE or Servlet container, that only uses core JEE servlets to be measurable.
Thanks
Thanks for pointing us to the right direction. All tests are using out-of-box default configurations. Stuart who is the author of Undertow expressed the same concern and thought the performance difference shouldn't be this big as there are several frameworks based on Undertow. Do you know how to change the threads on WildFly/Payara/Spring-Boot? I would be happy to rerun the tests with tuned configuration. Thanks.
I did a search and found out Spring-Boot/Tomcat default threads are 200 which is right on my I5 4 core aging CPU.
http://stackoverflow.com/questions/25399400/maximum-client-request-thread-pool-size-in-spring
Hi,
I don't really work with spring boot. But for Glassfish, here it is:
- start app server
- Login to admin
- Configurations->configuration-name->Thread Pools->thread-pool-name
- Set it to like 10 and see the results changing
https://docs.oracle.com/cd/E18930_01/html/821-2431/abehk.html
Also, Adam Bien has a very good video about this (and talks about 2:30 from http thread pools): https://www.youtube.com/watch?v=Nyq4vcEB6oc
For wildfly 10 you can find the doc here: https://docs.jboss.org/author/display/WFLY10/Undertow+subsystem+configuration
I will try to help you a bit more on this, if I can.
Also: If you need, I can prepare a servlet version to add to the benchmark list.
Thanks, Csaba
2017-02-15 15:06 GMT+01:00 Steve Hu [email protected]:
I did a search and found out Spring-Boot/Tomcat default threads are 200 which is right on my I5 4 core aging CPU.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networknt/microservices-framework-benchmark/issues/6#issuecomment-280019186, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1IrafeqppiN--Hegt6bB4vphebjT7Bks5rcwZjgaJpZM4MBqNW .
-- Üdvözlettel,
Sarkadi Csaba
Thanks a lot for your help. I have WildFly swarm in the benchmark and we can start there as it is a optimized version of wildfly designed for microservices. I've used JBoss WlidFly at work and it is too big and too heavy for microservices.
Several frameworks are based on servlet and they are all performed poorly. I am looking for some light weight servlet implementations like Resin etc. Which framework or platform for your servlet version?
Can you please explain what do you mean by too big and too heavy??? That is an insane reason. Too big? About 200MB installed, who cares? You only have to install it once, than you upload only some kb wars... Too heavy? What is too heavy? Just watch any video from Adam Bien, and you will see, it isn't heavy, it is rather lighweight.
Light weight servlet implementation is Netty, as I remember, but I am not a fan of servlet containers.
2017-02-15 20:20 GMT+01:00 Steve Hu [email protected]:
Thanks a lot for your help. I have WildFly swarm in the benchmark and we can start there as it is a optimized version of wildfly designed for microservices. I've used JBoss WlidFly at work and it is too big and too heavy for microservices.
Several frameworks are based on servlet and they are all performed poorly. I am looking for some light weight servlet implementations like Resin etc. Which framework or platform for your servlet version?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networknt/microservices-framework-benchmark/issues/6#issuecomment-280110438, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1IrbopVu0ZZE-fLdrgfn4IroX2rYOWks5rc0_kgaJpZM4MBqNW .
-- Üdvözlettel,
Sarkadi Csaba
I am watching the video and it look like he is using Paraya as example. Is he only talking about several thousands TPS? 200MB is just the install image and the memory footprint is what I am looking at.
Memory is now the cheapest element of server hardware. Memory footprint? That is not much for most JEE servers, but the best would be to see a benchmark when you are loading the server with like 100 parallel threads.
- febr. 15. du. 10:14 ezt írta ("Steve Hu" [email protected]):
I am watching the video and it look like he is using Paraya as example. Is he only talking about several thousands TPS? 200MB is just the install image and the memory footprint is what I am looking at.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networknt/microservices-framework-benchmark/issues/6#issuecomment-280140838, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1Ireqy0PVMtineBaTMoAVsIOdK9FOJks5rc2rAgaJpZM4MBqNW .
I think we have Paraya Micro in our benchmark already. Could you please help to tune it? Thanks.
Also single thread per request doesnt cut it in today's world of trying to build reactive systems. It would be better to see these benchmarks serialize an object to json as well.
Below is an example updated jax-rs endpoint/controller using async and dedicated thread pool, as well as @ApplicationScoped
resource.
Instead of CompletableFuture with a dedicated thread pool, you could use @Asynchronous
(EJB) on top of the getCars
method which will run this on the shared ejb-pool (or something like that). And by default AFAIK CompletableFuture runs on the shared fork-join pool if you do not provide it a thread pool.
@ApplicationScoped
@Path("/cars")
@Produces(APPLICATION_JSON)
open class CarController {
@Inject private lateinit var carService: CarService
private val executor = Executors.newCachedThreadPool()
@PreDestroy open fun preDestroy() {
executor.awaitTermination(1, TimeUnit.SECONDS)
}
@GET
open fun getCars(
@QueryParam("make") make: String?,
@QueryParam("limit") @DefaultValue("10") @Max(value = 10, message = "1001") limit: Int,
@QueryParam("offset") @DefaultValue("0") offset: Int,
@Suspended res: AsyncResponse
) {
res.setTimeout(2, TimeUnit.SECONDS)
res.setTimeoutHandler { it.resume(Response.status(Response.Status.REQUEST_TIMEOUT).build()) }
CompletableFuture.supplyAsync(Supplier {
carService.findCars(CarFilter(make, limit, offset)).thenAccept {
res.resume(Response.ok(Cars(
it.cars.map { Car(it.make.toString().toLowerCase(), it.model, it.color) },
Paging(it.total, limit, offset)
)).build())
}
}, executor)
}
}
It's been a long time that I haven't touched JAX-RS. Is it possible that you help to update the test case so that I can retest? Thanks.