![]() The numbers for Node.js system were as follows:Īs before the average response time has a linear correlation to the number of concurrent requests, keeping the requests that can be served per second pretty constant. Import class MyServlet extends HttpServlet ) The following Java code is a servlet that fetches a document from CouchDB by id and forwards the data as a JSON object. The driver has no caching options available, so no configuration was done. The database driver was CouchDB4J version 0.30. The Java servlet was run on an Apache Tomcat version 7.0.21, default configuration running on Java 1.6. The JMeter scripts fetched random documents from each application at various levels of concurrency. I used Apache JMeter running on a separate machine as a test driver. The test machine was a iMac with 2.4 GHZ Intel Core 2 Duo, 4 GB RAM, and Mac OS X. I created 10.000 sample documents of 4KB each with random text. I used CouchBase Single Server version 1.1.3. Both applications used the same backend as our original Node.js application: CouchDB. I ran the the same performance tests against both a Node.js application and a Java servlet application. To answer this question I designed a set of performance tests to be run against both a Java EE application and a Node.js application, both backed by the same CouchDB database, and looked at how the two systems compared. a traditional Java EE system be backed up by hard performance tests? So I went out to answer the question: Can the perceived performance of Node.js vs. I don’t know how a Java EE application would perform given those requirements. No complex SQL, no table joins, and no data manipulation. The core of our application only pulled out JSON documents by ID from a single table in a CouchDB database. Many Java EE applications I have worked on had response times that felt more like 1000ms, but they had more complex functionality than our Node.js application did. ![]() I asked myself: Is this really a good performance given the functionality of the application? Is Node.js just magically fast? What would the performance be if we would’ve gone with the established platform of Java EE? I was quite amazed that Node.js was outperforming the requirements by such a margin, and all of this without any performance optimisation. I am not a performance guru, 200ms response time sounded pretty fast, and my feeling was that we would have to tweak the application to reach those goals.Ī separate team ran performance tests against our application, and when the results came back the application actually had exceeded all performance targets: 200 requests/second at 100ms average response time. The Node.js project had to meet the following performance targets: 150 requests/second at 200ms average response time. You cannot generalise these results, though. Turns out the Node.js application actually was 20% faster than a similar Java servlet application running on Tomcat 7. TL DR I wanted to know how the performance of the application built on a vanilla Java stack would compare. Still I wanted to know: how would Java EE compare to Node.js in this particular case? Granted the project was perfectly suited for Node.js: a small project centered around fetching JSON documents from CouchDB. I never really experienced this in Java EE projects. ![]() ![]() In my last Node.js project it was the same: we beat the given performance targets without having to tweak the application at all. Node.js has impressed me several times with high performance right out of the box. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |