Well, the absolute maximum is however many can fit in to your system memory (RAM + swap). Of course by that point it may be that your machine is already being ground to a halt, so that's not necessarily a good metric to use.
The "max number" is more likely defined as how many instances can be running while your machine is still performing acceptably. The only way to find this out is to benchmark. Use one server and start loading it up with instances of your script. Find the ideal number by measuring the metrics that are important to you. It could be execution time, latency, network throughput, or whatever it is in your case. There are many variables and you need to identify the ones that matter. Try to find out where the bottlenecks are by profiling your script, and monitor your system I/O and network throughput to see if you can optimize your hardware for your application.
Also make sure you leave enough resources free on the server for administration overhead (being able to SSH in, run snmpd or other monitoring software).
If this sounds somewhat vague and general, that's because it is. You're basically asking people to engineer a complete hardware system for an application they know nothing about.