I need an Application object replacement. I was creating my own using
shared memory -- shm* API in PHP. I was doing fine for 6 months until
it just got too fat, I guess, and the RH9 Linux server just started
"losing its memory". I don't know -- perhaps I'm doing something
wrong, perhaps it's my code, or perhaps there's a limitation on what
I'm trying to do here. It's too many lines of code to debug right now.
I'm searching for alternatives.
The reason I was using this was because it sped up things so that
instead of a database hit, my pages hit server memory for small things
like caching reference tables that translate usernames to email
addresses, group codes to group descriptions, and so on.
Of course it's a dangerous thing to use an Application object in a
server farm, so what I do is I refresh it on every server upon user
login to the website. It hits the database and pulls the latest data
to populate that server's Application object. If I update a reference
table, I also have a script that refreshes this on every server. So,
there's like a 99.9999% chance that everyone's going to have the
latest Application object data.
....that is, until it got too fat, I guess.
Anyway, does anyone have any ideas on how to use a different technique
like environment variables; a socket service that caches the array to
RAM after reading it from a database every 15 minutes; or other
technique?
I could store the entries in a file, but the point is that I don't
want disk access here -- I want it in RAM.
My Linux server has 1GB of RAM. I calculated the shared memory stuff
I'm storing there and it's no more than 20MB.
shared memory -- shm* API in PHP. I was doing fine for 6 months until
it just got too fat, I guess, and the RH9 Linux server just started
"losing its memory". I don't know -- perhaps I'm doing something
wrong, perhaps it's my code, or perhaps there's a limitation on what
I'm trying to do here. It's too many lines of code to debug right now.
I'm searching for alternatives.
The reason I was using this was because it sped up things so that
instead of a database hit, my pages hit server memory for small things
like caching reference tables that translate usernames to email
addresses, group codes to group descriptions, and so on.
Of course it's a dangerous thing to use an Application object in a
server farm, so what I do is I refresh it on every server upon user
login to the website. It hits the database and pulls the latest data
to populate that server's Application object. If I update a reference
table, I also have a script that refreshes this on every server. So,
there's like a 99.9999% chance that everyone's going to have the
latest Application object data.
....that is, until it got too fat, I guess.
Anyway, does anyone have any ideas on how to use a different technique
like environment variables; a socket service that caches the array to
RAM after reading it from a database every 15 minutes; or other
technique?
I could store the entries in a file, but the point is that I don't
want disk access here -- I want it in RAM.
My Linux server has 1GB of RAM. I calculated the shared memory stuff
I'm storing there and it's no more than 20MB.
Comment