Rayhan420 Posted February 9, 2016 Share Posted February 9, 2016 Is there any way to grow my server's grabbing speed.I have made a script that grabs contents from another site.but my server's grabbing speed is too slow.is there any way to grow the speed.i am using shared hosting.so,i don't get that much of support for this.please help Quote Link to comment https://forums.phpfreaks.com/topic/300762-is-there-any-way-to-grow-my-servers-grabbing-script/ Share on other sites More sharing options...
kicken Posted February 9, 2016 Share Posted February 9, 2016 It depends on where the bottleneck is. If the problem is too much network traffic (which seems likely on a shared host) then there's not much you can do. If it's an issue of processing the results taking too long you may be able to speed it up by optimizing your code. Make sure your code is optimized so it will process results quickly. Do some benchmarks and profiling to determine where your code spends most of its time and see if there is any way to improve that area of code. Attempt to download different pages in parallel to make use of all the bandwidth you have available. You can do this with cURL and there are libraries available to make it easier. Quote Link to comment https://forums.phpfreaks.com/topic/300762-is-there-any-way-to-grow-my-servers-grabbing-script/#findComment-1530898 Share on other sites More sharing options...
Rayhan420 Posted February 13, 2016 Author Share Posted February 13, 2016 Example of optimizing my code Quote Link to comment https://forums.phpfreaks.com/topic/300762-is-there-any-way-to-grow-my-servers-grabbing-script/#findComment-1531060 Share on other sites More sharing options...
Psycho Posted February 13, 2016 Share Posted February 13, 2016 Example of optimizing my code There are literally hundreds, if not thousands, of way to "optimize" code. It all depends on what your code is specifically doing. If you are running queries in loops - don't. If you are using RegEx try and find string function alternatives, etc. etc. etc. It is a waste of time for us to try and suggest optimizations that may be appropriate for your need without seeing any code. Quote Link to comment https://forums.phpfreaks.com/topic/300762-is-there-any-way-to-grow-my-servers-grabbing-script/#findComment-1531061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.