Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
virtualsue uses arcane git commands to resurrect a file, gets it back into shape and quits for the day
[GotToBTru]: a few years ago, when we had 3 dogs, the largest of them caught a chipmunk, but did not know what to do with it other than hold it in his mouth
[GotToBTru]: my wife told him to spit it out, so he did
[erix]: yeah, modern dogs are cute tjhat way :)
[erix]: except of course, the RHODESIAN LION HOUND ! :)
[Discipulus]: in roma cars are good mouser.. fortunnately no mouse at 7th floor..
[GotToBTru]: that's a name that should always be accompanied by a trumper fanfare
[GotToBTru]: trumpet, not trumper
[GotToBTru]: good thing too, Discipulus, no roads on the 7th floor either
[GotToBTru]: okay, fess up, who installed CB::Typo?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-11-17 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?