开发者

Using shared memory on a shared hosting Linux account

开发者 https://www.devze.com 2023-01-13 08:50 出处:网络
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:

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!


  1. There could be multiple if they are doing load balancing, you would have to ask them.
  2. No, shared memory is shared across the current host, not multiple
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号