Jump to content

Server side forking and optimization


nirrud

Recommended Posts

Hi I am presently writing a code which does the following steps given a site

1) get some keywords (written a function for it)

2) search google for these keywords (I have used curl and getURL functions for these)

3) perform keyword search in the first page of googles results.

 

Presently I have used curl and curl_multi_getcontent but when i run the code it consumes 100% of my server.

My server will not respond in this case if someone else pings.

 

I have been trying to do pcntl_fork, but could you let me know how to optimize this code by threading and forking.

 

I am a newbe in PHP please let me know the structure of how to invoke multiple threads and process the same.

If you have someother suggestions please let me know that too.

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.