Highcharts PhantomJS - Alternative Approach

2019-08-19 19:32发布

This pertains to the new feature of Export Server + PhantomJS for server-side chart generation.

HSE below refers to Highcharts Serverside Export framework by one2Team.

Based on our initial analysis we find invoking the PhantomJS as a separate process is slower against HSE for both Pie charts and Bar charts we tested. We found that PhantomJS has a built-in webserver feature - Mongoose - ariya.ofilabs.com/2012/01/glory-of-the-snow.html which helps make process communication simpler (and also avoids the I/O in the infile, outfile approach). We could execute with that and found PhantomJS was equal or better than HSE in performance. But not sure yet on how much load it could take and respond in production traffic. Have you evaluated any such options?

1条回答
冷血范
2楼-- · 2019-08-19 20:00

Highcharts export-server for serverside generation, could be improved on two things.

  1. Reusing the phantomJS process instead of starting up a process for every conversion. This could be avoided by running the script as a webserver-module. An other possibility is writing directly to the process by stdin/stdout. But this is not yet fully implemented to my knowledge.
  2. Avoid creating of temporary files for communication between the export-server and the phantomJS script.

While working on these improvements I have the following test-result while running locally

Current release:

  • converison 2000 points > 5 seconds timeout reached
  • 12 points graph (llexl) takes 620ms

With above improvements:

  • 2000 points takes 660ms
  • 12 points graph (llexl) takes 250ms
查看更多
登录 后发表回答