I recently posted a support topic where the /tmp directory of johnny filled up and this resulted in a user having their account suspended due to them taking up too many resources. This was understandable, but then a question entered my mind: How much of the resources do I use?
My first thought was server load. Then vars & tmp directories. At the moment, I'm not using much as my site's still in the early stages of development and It's basically hidden from the world (No Meta tags). I only have a couple of people popping in occasionally to help me with testing.
But it occured to me: I have and will be running some fairly complex mySQL queries and some recursive PHP functions. Being mostly a userbase of 1 right now, that's fine. However, if I had a page taking 0.1% of the server when used and I suddenly jumped to 300 users at any given time, my account would be gone in a blink of an eye. I like the setup here and I don't want that, unless my site's presence here becomes completely unrealistic and I have to move to paid hosting.
I have to be realistic about the demand I place upon the server.
The trouble is, I've no idea how to estimate the % server load a query/function call creates. Having consideration for other users, I'd like to test MySQL calls and PHP functions and calculate or in the very least estimate the server load created.
A regular execution time function will produce varying results based on server load so I reckon I'd be barking up the wrong tree there.
All said, I reckon prevention is better than cure and an eventual solution could benefit all users. If anyone has ideas about estimating server load, or wishes to point me towards something that I've overlooked, I'll be ecstatic.
Xoviat.