FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PDO based Abstraction Layer for MySQL with Caching
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PDO based Abstraction Layer for MySQL with Caching [message #180809 is a reply to message #180807] Tue, 19 March 2013 23:49 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 19/03/13 22:56, CPHR wrote:
> I am curious if anyone here can recommend a good abstraction layer
> for MySQL preferably PDO based. Something that has good caching
> that's automatic, for example I run the query and it will check to
> see if it has a cached result before attempting to do the query. I
> have been using EZ SQL but the caching leaves a lot to be desired and
> it uses the old mysql_* functions of PHP which are going to be
> depreciated.
>

mysql caches its results anyway.

ITYM deprecated. Not depreciated :-)

There is no need to have an abstraction layer to do that.

One might suggest that you investigate how to improve mysql caching -
give it more memory for example.

In my /etc/mysql/my.cnf are these lines

query_cache_limit = 1M
query_cache_size = 16M

Those are highly adjustable. On a big system I would up the size to a GB
or more, and the limit to 256MB. If that system is being worked hard
with similar selects ..

See:

http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_ query_cache_limit

In addition judicious indexing can massively improve (some) slow queries.

This is all done at Mysql level: the PHP mysql libraries are only shims
to allow PHP to call into the daemon.

old or new, they do the same basic calls and ALL the time is in the
mysqld daemon on anything beyond a short select into a small table.

When I was working on a complex join, the uncached select was over 4
seconds, the cached was 30ms. With indexes added (occasional insert
update, MANY reads via select) the uncached was down to 250ms..

The actual query result wasn't large on that so it always cached OK


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: split array and string from string (trust me it will make sense when you read)
Next Topic: APC issues: locking up all processes and lack of PHP 5.4 support
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 11:57:07 GMT 2024

Total time taken to generate the page: 0.04655 seconds