I need to run a memory intensive task (say Task A) on server. Since its memory intensive, I want to run only limited number of parallel instances of such tasks A. The other request to run the task, will be queued, if the number of already running such task has reached the limit.
On server side web programming, what is the best way to implement the task? As Web services?
I am using php and symfony2 framework for my web application.
Thanks