Reputation: 3691
Some pages are taking a long time to load. I assume its from all the PHP - using a lot of fopen
and fget
statements. What can I do to make these pages load more quickly?
Upvotes: 0
Views: 110
Reputation: 53879
Upvotes: 1
Reputation: 255115
If you really need to perform a lot of remote calls with fopen
- I would suggest you to create some kind of queues and implement some worker, that can work with threads in simultaneous manner.
So in your php code you put the "tasks" to the queue and waiting for the answers. In the same time fast and performant daemon (written in c/c++/python or whatever language that supports threads well) reads the tasks from queue and puts the responses into another queue.
Upvotes: 1
Reputation: 41861
A database may be faster if you're using a lot of file resources as a data layer solution.
Alternatively, consider caching your pages, beginning with client-side HTTP caching and considering server-side caching later.
Beyond that, more details are needed (at which stage we're basically consulting for you).
Upvotes: 2