multithreading - PHP load balancer for data processing application -


application taking data mysql, processes , puts back. works on php & mysql.

app runs on cron jobs, process_launcher cron job scheduled run every minute, , starts 500 other php processes (threads) , processes choosing data process (1 piece of data = 1 row) , update after it's done. processing data takes 40-50 seconds per thread.

now i'm moving application on cluster 2 load balancers, 2 processing servers , 2 database servers (all pairs master-slave) , need ideas on how load balancer should work.

i'm thinking move process_launcher on load balancers (it'll launched cron job on both) , make start threads on randomly chosen processing server (maybe not random on 1 has less load, i'm not sure yet how detect server least load enough)

any better ideas appreciated.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -