Performance php + mongodb + Graphics

Asked

Viewed 79 times

1

Good morning wonderful people, I am beginner in development and I have an issue that has taken my sleep, I am testing a system in php with mongoDB database, in which is generated a graph with metrics of all records of mongodb (amount of records +- 700K), metrics like, which device you used, gender, which link you clicked, which email provider among others. this has taken an eternity to generate the chart, after some testing I’m sure that the speed is caused by php, to get a very large amount of records. Does anyone have an idea how to improve this performance? reminded that the data is captured after a person browse my site(are at least 100 new regitros per day).

Remembering, I’ve tried to cache by cron only with the relevant data and even then the amount is gigantic.

Thank you!

  • Are you reading and scanning these logs at each request to generate the charts? If yes, what you can do is, in addition to storing each click, assemble a data structure in your database with the data already consolidated, only with what is necessary to create/display the charts.

  • this cache that I said I made, that’s exactly what @Newtonwagner, yet this structure is getting gigantic

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.