I am building a web site and want to provide public API to everobody without registration. The api will perform search function, and as database is big it will consume a lot of resources. So I want to seriously limit memory, process time, ect. Also I will use public hosting (non personal or dedicated), so I will not have any access to process control (I suppose). What do you recommend to do?
I think of using one global variable that will store last successful script executing time and will terminate script if enquery is more than in 1 sec. I was not able to find super global (across all scripts) variables, so will use file with lock on it.
But anyway, any php script execution control???