Ahmed
Ahmed

Reputation: 1359

Http response time with nodejs compression is taking more time than without compression

I am trying to perform a load test with jmeter on my nodejs server. I found that the average http request response times for N concurrent user and the standard deviation is longer when using compression module than without using it. Is this something normal and what could the reason for that

Upvotes: 1

Views: 613

Answers (1)

jfriend00
jfriend00

Reputation: 707436

Compression benefits you when the bandwidth speedup from delivering fewer bits by compressing is more important than the extra CPU that the compression takes. If you're running a local test over a fast network, then the bandwidth savings of compression may not be able to overcome the extra CPU load that the compression takes.

A local network test may not be representative of what would happen between a real set of clients and your server over a longer internet link that isn't as fast as a local network.

The slower the network link, the bigger the difference the compression might make. It also depends upon how large the http responses are. Small responses will not benefit much from compression either. Large responses have much more of a chance of benefiting from compression and even more on slower links.

Upvotes: 3

Related Questions