Grokbase
x

Tobias Kremer (l...@funkreich.de)

Profile | Posts (87)

User Information

Display Name:Tobias Kremer
Partial Email Address:l...@funkreich.de
Posts:
87 total
39 in Catalyst Framework
35 in DBIx::Class
3 in dbix-class@lists.scsys.co.uk
3 in HTML::FormFu
7 in HTML::Widget

5 Most Recent

All Posts
1) Tobias Kremer [Catalyst] best practices - model or controller ?
| +1 vote
When deciding where to put things (model vs. controller) I always imagine what would happen if I...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On 04.10.2008, at 08:16, Yves R?ber wrote:
> I want to implement something really simple : log some events into a
> database. And I already can think of three way to do it, but because
> this will be used very frequently I'd like to know what's the best
> solution. For me the best solution would be to have little overhead,
> and
> a really short command (like $c->logdb()).

When deciding where to put things (model vs. controller) I always  
imagine what would happen if I took the Catalyst part away. In most  
cases the model should be able to fulfill everything without Catalyst  
being involved (for instance, if you'd like to use your model from a  
cronjob script). Thus, in this case, I'd definitely put the logging  
into the model to have it log everything even when Catalyst is not  
involved. I assume that every logging action goes together with a  
create/update/delete of model objects and is rarely triggered alone.  
If that's the case, have you thought about overriding the create,  
update, delete methods DBIC provides to add the logging there? That  
way you'd have to do it only once and every (write) action on your  
model is automatically logged.

--Tobias
2) Tobias Kremer [Catalyst] Duplicate entries with C::P::Session::Store::DBIC and MySQL - new findings
| +1 vote
Quoting Jonathan Rockway <jon@jrock.us>: Hmm .. That wasn't really my point. I was trying to say...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Quoting Jonathan Rockway <jon@jrock.us>:
> * On Wed, Aug 27 2008, Tobias Kremer wrote:
> > We definitely should! IMHO five queries per request to the database just
> > for the session and flash stuff is inacceptable.
> If your app is really slowed by the number of queries to load
> session/flash, use this:

Hmm .. That wasn't really my point. I was trying to say that it should
theoretically be possible to reduce the database queries from 5 down to 2
without losing any of the functionality just by changing the way the flash DBIC
storage is implemented.

On a side note: I have replaced all my $c->flash calls with a custom method that
stores the flash message in the already existent $c->session hash. I haven't had
a single "duplicate entry" error since that change. So implementing the
suggested change would eliminate the race condition, too. Unfortunately I
haven't had any luck patching the existing DBIC session store to utilize the
session instead of separate "flash:" entries :(

--Tobias
3) Tobias Kremer [Catalyst] Intermittent blank pages
| +1 vote
Quoting Matt S Trout <dbix-class@trout.me.uk>: Awesome! Didn't know this plugin existed! I'll give...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Quoting Matt S Trout <dbix-class@trout.me.uk>:
> You might want to load Catalyst::Plugin::AutoRestart as well so the processes
> restart themselves gracefully at the end of a request before it hits the
> softlimit.

Awesome! Didn't know this plugin existed! I'll give it a try.

> I notice downthread you've solved the underlying problem, but adding
> AutoRestart into your setup would mean that if something similar goes wrong
> again you'll avoid the firing blanks problem.

Yes, the memory leak in Rose::HTML::Form caused the application to grow _very_
rapidly in size leading to many process restarts in the middle of a request. I
suppose the blank page still shows up from time to time, but much less often.
The plugin you mentioned should solve this once and for all though.

--Tobias
4) Tobias Kremer [Catalyst] Intermittent blank pages - possibly solved
| +1 vote
Quoting Tomas Doran <bobtfish@bobtfish.net>: Okay guys, Rose::HTML::Form seems to leak memory like...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Quoting Tomas Doran <bobtfish@bobtfish.net>:
> On 28 Aug 2008, at 19:32, [email protected: Wade.S...@fallon.com] wrote:
> >> That was my guess, too. But if the problem is really situated
> >> there it should have occurred much earlier. Nothing dramatically
> >> changed in our setup or application. I'll try a rollback of the
> >> Rose::HTML::Form module to eliminate it from the equation.
> >> Any other thoughts are still greatly appreciated!
> Are you leaking memory (or is Rose leaking memory for you)? Using
> something like Devel::Leak::Object could help you here..

Okay guys, Rose::HTML::Form seems to leak memory like mad. I've tried every
single version from the most current one (0.554) downwards and checked the
memory usage with a simple Catalyst application. The process size became stable
after downgrading to Rose::HTML::Object 0.549. So the latest six versions have a
huge memory leak (the cat process grew up to 100 MB with nothing but a simple
form after using ab to hit the app with 1000 requests)!

I'll file a bug report and take a look at what's going on under the hood.

--Tobias
5) Tobias Kremer [Catalyst] Intermittent blank pages
| +1 vote
That was my guess, too. But if the problem is really situated there it should have occurred much...
catalyst@lists.scsys.co.uk
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On 28.08.2008, at 18:48, [email protected: Wade.S...@fallon.com] wrote:
> Is it possible that the concat error and resstart are related
> (memory load)
> but the blank pages are due to the restart killing (restarting) the
> procs
> off before the fastcgi payload is sent

That was my guess, too. But if the problem is really situated there it  
should
have occurred much earlier. Nothing dramatically changed in our setup or
application. I'll try a rollback of the Rose::HTML::Form module to  
eliminate it
from the equation. Any other thoughts are still greatly appreciated!

--Tobias

spacer
Profile | Posts (87)
Home > People > Tobias Kremer