Jump to content

How to execute 100 scripts in parallel?


B0b

Recommended Posts

Hey guys,

 

I need to know how I could go about running 100 different PHP scripts, which are on my server, simulteanously? Each of these scripts need to run for several minutes.

In other words, what would be the best way to do multi-threading with as much as 100 different instances?

 

I used to pop up a new window via Javascript for this, but, now, for 100, that would be unmanageable.

 

Please, shed some light on this!

Link to comment
Share on other sites

Because I wrote a script/program and client asks to have it 100 times faster and there are no other way than having 100 of them running at once?  :shrug:

There's really no other option. I understand PHP and web servers aren't the best platform for this but... unfortunately it's too late to go back. Hopefully the server is solid enough to handle it, I'm just unsure about what would be the most suitable way through PHP or Javascript to get this party started  :confused:

 

Thank you.

Link to comment
Share on other sites

Because I wrote a script/program and client asks to have it 100 times faster and there are no other way than having 100 of them running at once?

 

That makes little sense.

 

Besides, threading is not available in php within a web server environment.

Link to comment
Share on other sites

if you insist on running 100 script you can try multi handler with curl

Sounds interesting! So cURL would execute all the handles (pages) simulteanously and not wait for the first to finish then go the the second?

I did thought about cURL at first, but forgot about multi handling. Anyways, I'm curious how page's data (pages' HTML) are returned? Is it once all handles are loaded or gradually?

 

Thank you very much!

Link to comment
Share on other sites

Cron

Batch// part of atd// can call a list file

Task Spooler

You might get either of these to work. Cron should be able to handle 100 at a pop. If it cant it will run what it can and then wait for 60 seconds and carry on from where it left off.

 

 

HTH

Teamatomic

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.