HandlerSocket-Plugin-for-MySQL icon indicating copy to clipboard operation
HandlerSocket-Plugin-for-MySQL copied to clipboard

Handler socket and query cache

Open fujohnwang opened this issue 15 years ago • 18 comments

After our tests, we found that update the table with HS will not invalidate the query cache, did we miss something or that's the result?

fujohnwang avatar Dec 02 '10 08:12 fujohnwang

Invalidating the query cache is not implemented yet.

ahiguti avatar Dec 02 '10 08:12 ahiguti

that will be a feature in the future? :-)

fujohnwang avatar Dec 02 '10 08:12 fujohnwang

I want to implement it in the near future.

ahiguti avatar Dec 02 '10 08:12 ahiguti

it's great to know that, wish HS will be more powerful and popular ^_^

fujohnwang avatar Dec 02 '10 08:12 fujohnwang

I'm working on various HandlerSocket components for django framework (http://bitbucket.org/dchaplinsky/django-hs-cache, http://bitbucket.org/dchaplinsky/django-hs-sessions) and also started to implement monkey patch for django ORM which will route all suitable requests via HandlerSocket.

Absence of query cache invalidation is causing some problems when I'm mixing usual requests via mysql bindings with handlersocket ones. Do you have any ETA for this feature?

Thanks

dchaplinsky avatar Dec 15 '10 00:12 dchaplinsky

dchaplinsky,

Thanks for those django-handlersocket projects. This is great!

I'm particularly interested in your patched Django ORM. Where can I find it? What types of requests are routed through HandlerSocket? Can it route inserts and updates to HandlerSocket?

Thanks.

selforganized avatar Dec 15 '10 03:12 selforganized

At the moment, it's on proof of concept stage. I already did the part which finding appropriate selects, made via ORM, inserts and updates should be even easier. I will continue work on this weekends. But as you may understand, without query cache invalidation it just won't work. Actually, I disabled culling in hs-cache backend because of this, since it requires some SQL and when I'm doing select count(*) from it just returning zero all the time.

dchaplinsky avatar Dec 15 '10 08:12 dchaplinsky

That's essential part of finding select requests suitable for HS https://gist.github.com/669070

dchaplinsky avatar Dec 15 '10 13:12 dchaplinsky

Great! Please keep me posted about your progress. Perhaps you could start a project on the HS-enabled ORM?

About query cache -- if you turn off query cache on MySQL then everything should work fine, right?

Many people recommend turning off MySQL query cache anyway because in a heavily loaded server, any time you insert/update a table, the entire query cache needs to be invalidated. All that thrashing of the query cache ends up making MySQL slower instead of faster.

selforganized avatar Dec 15 '10 16:12 selforganized

I will try just to ensure if the problem is in query cache.

As you may understand, such components should work with any mysql settings.

Regarding django ORM patch — I will start the project, once I will have working prototype.

dchaplinsky avatar Dec 15 '10 16:12 dchaplinsky

The latest version of HandlerSocket invalidates the query cache if data is modified. Please try.

ahiguti avatar Jan 08 '11 02:01 ahiguti

Hi,

Is there any ETA on when HS will invalidate query cache when new data has been added to the table? Should I open a new ticket for this?

thijsdezoete avatar Aug 22 '11 10:08 thijsdezoete

What is ETA?

ahiguti avatar Aug 22 '11 13:08 ahiguti

Estimated Time of Arrival, as in, do you expect this feature/issue to be finished anytime soon?

thijsdezoete avatar Aug 22 '11 13:08 thijsdezoete

Query cache invalidation was added back in January, as you can see in the comment just above yours.

WheresWardy avatar Aug 22 '11 13:08 WheresWardy

Yes, but as far as I could see, it was only implemented for updates, not for new writes/inserts, am I correct?

thijsdezoete avatar Aug 22 '11 13:08 thijsdezoete

Nope, should work for inserts, updates and deletes. I think invalidating the query cache against just updates would probably be a lot more work :p

WheresWardy avatar Aug 22 '11 14:08 WheresWardy

WheresWardy is correct.

ahiguti avatar Aug 22 '11 14:08 ahiguti