Sunday, October 6, 2013
WebSocketServerPush vs ZKComet Performance Testing
Simple Note
Testing Environment
Server:
Tomcat 7.0.42
ZK Version:
6.5.2
WebSocket ServerPush Implementation:
ZK ServerPush with WebSocket - Rework
http://ben-bai.blogspot.tw/2013/10/zk-serverpush-with-websocket-rework.html
Testing Steps
1. Start Tomcat
2. Open visualVM
3. Open 5 testing pages
There are 2 cases for WebSocket ServerPush, push to desktop separately (index.zul) and push to all desktop at once (index_per_desktop.zul), 1 case for ZK Comet (push to desktop separately - index.zul)
4. Wait 2 minutes
5. Take snapshot
Testing Result
(Click snapshot to view large image)
Executing Result:
ZK Comet - index.zul
WebSocket ServerPush - index.zul
WebSocket ServerPush - index_per_desktop.zul
JVisualVM
ZK Comet - index.zul
WebSocket ServerPush - index.zul
WebSocket ServerPush - index_per_desktop.zul
Observation
Execution Speed
WebSocket ServerPush is two times faster than ZK Comet
Memory Consumption
Highest: WebSocket ServerPush (215/187 MB for per-desktop/push-to-all) is two times higher than ZK Comet (100MB), resonable since WebSocket is faster, do more work and use more memory at the same time.
Lowest: Almost the same (20 ~ 23 MB), most of the memory can be GCed.
CPU Usage
WebSocket AU (2%~8%/1%~6% for per-desktop/push-to-all after page loaded) is better than ZK Comet (1%~24% after page loaded).
Conclution
WebSocket do double work with 1/4 ~ 1/3 CPU Usage and double Memory Consumption.
Download
Testing projects at github
https://github.com/benbai123/ZK_Practice/tree/master/General/Performance_Testing/WebSocketServerPush_vs_ZKComet
Labels:
HTML5,
Performance,
Web Server,
ZK
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment