SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to use memcached?

    Hello,

    I would like to start using memcached for some of my sites db queries. Especially for a page I'm building right now that's similar to the d.i.g.g.com spy page, where it queries the DB once every 5 seconds and uses ajax to display new rows that has been added. Since i might have a couple hundred people viewing this page at any given time, it seems like it would be vital to have the queries memcached..

    Is it possible to use memcache for a query and have it time out after 5 seconds? That way if it runs the query 60 times within a 10 second span, lets say, it will have only actually queried the DB twice, is this right? I just want to make sure I'm understanding what memcached does exactly.

    Thanks,
    Gabe

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you're better off using the bog standard MySQL query cache. It simply caches result sets so that if the same query is executed while the data is still fresh it will be instantly returned.

    Still sounds like a fairly heavy feature though, didn't realize that **** did this.

  3. #3
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    Sounds like you're better off using the bog standard MySQL query cache. It simply caches result sets so that if the same query is executed while the data is still fresh it will be instantly returned.
    Yeah, seldom-write databases is where MySQL query cache works the best.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •