Re: Buffered Logging?
| From: | Jerry Wilborn | Date: | Fri, 07 Aug 2009 23:56:50 +0000 |
| Subject: | Re: Buffered Logging? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296441@lists.php.net to get a copy of this message | ||
You don't mention what database you're using, but mySQL supports memory
based tables. You can use this to insert your single page loads and then
have a job that periodically inserts in bulk.
Memory based tables:
http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html
Jerry Wilborn
jerrywilborn@gmail.com
On Fri, Aug 7, 2009 at 5:46 PM, Waynn Lue <waynnlue@gmail.com> wrote:
> Hey PHPers,
>
> We've been doing sampled logging to the database in our application for
> awhile, and now I'm hoping eventually to blow that out to a larger scale.
> I'm worried about the performance implications of logging to our database
> on
> every single page load, though, so I was wondering if anyone's found a
> solution that does buffered logging. Essentially it would log to memory
> (memcached/apc/etc), and then periodically dump to a database in a
> structured format, preferrably user-defined. It's not essential that we
> get
> every signle hit, so I'd be fine if there was some data loss on a restart.
> I started writing my own solution, and then thought I'd ask the list to see
> if anyone has any experience with other tools that do this.
>
> My Google searches around "buffered logging" have mainly found error
> logging
> packages, like PEAR's Log package, or log4php. Those all seem to write to
> only one particular stream at a time, with no real support for buffering it
> in memory and then moving it to database.
>
> Thanks for any help!
>
> Waynn
>