October 14, 2003
RAM questions
So Tabulas has started to get slower. Besides saving up to rent out another new server for a year to help alleviate the load on the site, I've been looking at huge bottlenecks within the site.
The primary users table is an incredibly high-probability place for clashing locks. I've had to move the user status information to the sessions (which helps alleviate load on the user). This helped the performance of the site minorly, but I'm more interested in larger gains ... until it hit me.
Duh, why don't I just cache the main page? There are seriously some high-level queries on the main page (which displays the most recent data) that I could move to a cache that would improve performance. Each time that page was getting loaded, there were something like 60 queries sent to mySQL. Not very efficient.
So I did. The main page is now handled by a 2-minute cache (which helps performance A BUNCH). This got me to thinking though ...
How nice it would be to start storing the more requested data directly in the RAM instead of storing files on the disk. Even spinning up the disk drives for data is slow for a flat file (on a widespread server level) ... ideally the most recent data could be stored directly in RAM (at most it would take ... 10K of RAM, which is nothing). This would help a bunch in performance, but I'm not sure if PHP can handle this. Ill have to take a look into it.
I know LiveJournal's Brad moved a lot of stuff over to memcached, which I believe is a system to help alleviate mySQL loads by storing the more-recent data directly in RAM. This is a good idea, although I would be skeptical to move a whole site over to it, it would be nice for storing highly requested lookups like userid -->>username lookups on Tabulas.
The primary users table is an incredibly high-probability place for clashing locks. I've had to move the user status information to the sessions (which helps alleviate load on the user). This helped the performance of the site minorly, but I'm more interested in larger gains ... until it hit me.
Duh, why don't I just cache the main page? There are seriously some high-level queries on the main page (which displays the most recent data) that I could move to a cache that would improve performance. Each time that page was getting loaded, there were something like 60 queries sent to mySQL. Not very efficient.
So I did. The main page is now handled by a 2-minute cache (which helps performance A BUNCH). This got me to thinking though ...
How nice it would be to start storing the more requested data directly in the RAM instead of storing files on the disk. Even spinning up the disk drives for data is slow for a flat file (on a widespread server level) ... ideally the most recent data could be stored directly in RAM (at most it would take ... 10K of RAM, which is nothing). This would help a bunch in performance, but I'm not sure if PHP can handle this. Ill have to take a look into it.
I know LiveJournal's Brad moved a lot of stuff over to memcached, which I believe is a system to help alleviate mySQL loads by storing the more-recent data directly in RAM. This is a good idea, although I would be skeptical to move a whole site over to it, it would be nice for storing highly requested lookups like userid -->>username lookups on Tabulas.
Comment with Facebook
Want to comment with Tabulas?. Please login.
SuperSunJ
Glad to hear that you're making progress with Tabulas. I've learned a lot from all your posts in the Web Development section.