I want to optimize the access to some files that are always read by my custom script, using the shared memory functions of PHP. But there are some questions I have:
- In a shared hosting开发者_JS百科 (like GoDaddy's Linux Unlimited Hosting), is a single computer executing all of the script's instances, or could there be several computers due to load balancing?
- If there are several computers executing the script, is the same shared memory accessed by all of them?
- And, how much shared memory is it possible to allocate? I'd like to load some megabytes of data.
Best regards!
- There could be multiple if they are doing load balancing, you would have to ask them.
- No, shared memory is shared across the current host, not multiple
- Depends on system ram and limits in place by the system administrator.
A better solution would probarbly be to create a MySQL table with the engine type of HASH, which makes it a memory table. This would work around the issue of load balanced setups and also keep your data away from other users on the same server.
精彩评论