stephpy/timeline-bundle

Performance problem with notifications

Closed this issue · 8 comments

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 ?

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.

@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

@Toinouu greats !!!

Can you make a PR with theses changes please ?

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

#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.

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

OMG, you're right :s

That's fixed & merged.