Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Hardware to run heavy dbix::class stuff?

by chrestomanci (Priest)
on Sep 19, 2011 at 19:47 UTC ( #926798=note: print w/replies, xml ) Need Help??


in reply to Hardware to run heavy dbix::class stuff?

I think you are taking the wrong approach. If you do thing right then most of the heavy lifting should take place inside your relational database engine (MySQL in this case).

As you said, there is a large performance penalty when DBIx::Class creates objects from rows in the database. This is a known bottleneck with any Object relational mapper. It exists because by choosing to use DBIC, you have traded a little performance for convenience. It is hitting you hard because you have created lots of objects.

What I think you should be doing is designing your database schema, and writing better queries so that DBIC only inflates the objects you really need. For example could you pre-calculate some stuff and store it as extra rows in your database so that calculations happen faster? Could you indexes or views to your database to further speed things up?

Once you have succeeded in shifting the load to MySQL, then your problem will become one of optimising the performance of that database, which is not something we are expert in, though I suspect that by the time you reach that stage, you will have gained acceptable performance as you will have eliminated the DBIC object inflation penalty.

  • Comment on Re: Hardware to run heavy dbix::class stuff?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926798]
help
Chatterbox?
[ambrus]: I think the minimal implementation here is just a timer and io function, plus pushing to the @REGISTRY.
[Corion]: ambrus: Yeah, at least that's what I think I'll start with. A timer and potentially the dummy IO function that never is ready
[ambrus]: That only lets you invoke the main loop from Prima->run;, not from AnyEvent->condvar- >recv; but that shouldn't matter
[Corion]: ambrus: Details ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2016-12-08 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.