Multi-Threading in Laravel

旧巷老猫 提交于 2019-12-05 12:01:13
Chris

Multithreading is possible in PHP which has been discussed on Stackoverflow before: How can one use multi threading in PHP applications

However I don't know how much multithreading will help you here. How much data are we talking, what kind of accuracy are you looking for in the charts? How many charts are being shown? A lot of the solution will come from context.

If it were me, I would have a background schedule pre-processing the "huge" amounts of data into something more useful/usable on the frontend. Again useful/usable entirely depend on the context. When there is an actual page request, you just need to pass down the processed data, versus actual "live" data.

Again, again, this will entirely depend on the context of your application. Perhaps you need by-the-minute data, maybe you don't.

Chris is right - it all depends on your application, but if you are are getting to the point where application is not usable, you should look in into cashing your results in redis or memcached.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!