stephpy / timeline-bundle

Symfony2 bundle to make timeline
192 stars 57 forks source link

Performance problem with notifications #123

Closed Nelrann closed 10 years ago

Nelrann commented 10 years ago

We use Timelinebundle and we have performance problem with notifications.

When notifications was deleted with UreadManager, mongo increases much value locked db (mongostat).

You know where this problem come from ?

stephpy commented 10 years ago

Hi,

I don't know, it uses this method https://github.com/stephpy/TimelineBundle/blob/master/Driver/ODM/TimelineManager.php#L81-L95 but it'm not confortable with mongo. Try to do the same thing (or with other ways) with doctrine and see if it could fix the problem. If you find a solution, we could implement it on ODM/TimelineManager.

Nelrann commented 10 years ago

@stephpy I solved the problem by adding indexes

Action 
@ODM\Indexes({
 @ODM\Index(keys={"subject"="asc", "statusCurrent" = "asc"}),
 @ODM\Index(keys={"subject"="asc", "statusWanted" = "asc"}),
 @ODM\Index(keys={"subject"="asc", "verb" = "asc", "createdAt" = "asc"})
})
Timeline
@ODM\Index(keys={"context"="asc", "subject"="asc", "type"="asc", "createdAt"="asc"})
Component
 @ODM\Index(keys={"model"="asc", "identifier"="asc"})
 @ODM\UniqueIndex(keys={"hash"="asc"})

I think we can add it directly in the bundle

stephpy commented 10 years ago

@toinouu greats !!!

Can you make a PR with theses changes please ?

Nelrann commented 10 years ago

@stephpy yes

stephpy commented 10 years ago

Mapping in this bundle is defined in XML format. I made the PR here:

https://github.com/stephpy/TimelineBundle/pull/130

Can you confirm @toinouu it's OK please ?

I followed https://raw.githubusercontent.com/doctrine/mongodb-odm/master/doctrine-mongo-mapping.xsd and this doc but i didn't test it on my environment.

Nelrann commented 10 years ago

@stephpy I think you changed wrong file Component.orm.xml => Component.mongodb.xml but your mapping is OK +1

stephpy commented 10 years ago

OMG, you're right :s

stephpy commented 10 years ago

That's fixed & merged.