且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

php线程和脚本执行

更新时间:2023-01-18 23:22:49

是的,可能的.通过AJAX调用您的php脚本,并动态创建ajax函数的多个实例.请参阅所附的屏幕截图.当我比较运行单个函数与24个实例的结果时,我的数据处理速度提高了大约15倍.我正在尝试用约3000万条记录填充MySQL表,并且每条记录都涉及基于lat/lng的距离市中心的距离(以英里为单位).是的,它不在公园散步.如您所见,我的平均期望是:

Yes, its possible. Call your php script via AJAX, and and create multiple instances of the ajax function dynamically. See attached screenshot. When I compared results of running a single function versus 24 instances, my data was processed about 15x faster. I am trying to populate a MySQL table with about 30 million records, and each record involves calculating distance in miles from city center, based on lat/lng. So yes, its no walk in the park. As you can see, I am averaging about See this:

多线程http://gaysugardaddyfinder.com/screen2.PNG 多线程http://gaysugardaddyfinder.com/screen.png

这可能是一个光荣的骇客,但事实并非如此-但这确实对我很有用.

This may be a glorious hack or what not - but it sure worked great for me.

我的服务器是具有64 GB RAM的Xeon 72 Core设置.

My server is a Xeon 72 Core setup with 64 GB RAM.