Friendica Admins reshared this.
Slow photo requests / inbox requests
Hi !Friendica Admins ,
I'm currently tracing down performance issues, I' currently suffering from on my nodes opensocial.at and friendica.me .
It seems like the main performance problems are
- delivering photos
- [code]/inbox/code] requests
You can see some peeks and some long runners here:
The long runners (10sec) are the /inbox requests, the peaks are delivering photos after opening conversations, network pane, ...
Do you have any hints how I could improve these two types of requests?
The database is currently using ~50GB RAM, I set them as high as possible.
Friendica Admins reshared this.
Hypolite Petovan
•Friendica Admins reshared this.
Philipp Holzer
•@Hypolite Petovan @Philipp Holzer it's a XFS filesystem on a LVM
Hardware:
Roland Häder likes this.
Friendica Admins reshared this.
Hypolite Petovan
•Friendica Admins reshared this.
Philipp Holzer
•Hypolite Petovan likes this.
Friendica Admins reshared this.
Roland Hรคder
•xdebug
and setmode=trace
. Then use e.g.kcachegrind
to analyze it, e.g. which method takes the most time. That might be a start! Yes, you normally want to havexdebug
disabled on live (no development) servers. But this is an exception as high load cannot be simulated properly to find the bottleneck.Philipp Holzer likes this.
Friendica Admins reshared this.
Michael Vogel
•'decoupled_receiver' => true,
in your config. Then the inbox requests would be much faster. Then the processing is done via worker processes.like this
Roland Häder and Philipp Holzer like this.
Friendica Admins reshared this.
Michael Vogel
•But that one is tricky to set up. Best is to store the photos in a folder outside the web folder and then you can define a rule in your webserver that will redirect requests to the avatar folder to that folder.
Roland Häder likes this.
Friendica Admins reshared this.
Roland Hรคder
•Friendica Admins reshared this.
Philipp Holzer
•Roland Häder likes this.
Friendica Admins reshared this.
Michael Vogel
•Philipp Holzer likes this.
Friendica Admins reshared this.
Philipp Holzer
•Friendica Admins reshared this.
Michael Vogel
•Philipp Holzer likes this.
Friendica Admins reshared this.
Philipp Holzer
•/photo/contact
route for the avatar cache, don't I?Friendica Admins reshared this.
Michael Vogel
•No, the setup process is completely different. You have to have a path (somewhere) that is both readable and writable by the frontend and backend process
This path needs to be reachable when you call
https://your.server.tld/avatar
(you have to redirect/avatar
) or you have to defineavatar_cache_url
.You you setup the file path from above in
avatar_cache_path
and setavatar_cache
to true. After you deactivate the caching of the avatars in the admin frontend, it should work.The URL path is stored in the contact table fields. So once you defined that URL, you mustn't change it again, since all old requests would fail. This mechanism is powerful, but currently too easy to misconfigure, that's why it is only accessible via the config file.
Friendica Admins reshared this.
Philipp Holzer
•Friendica Admins reshared this.
Michael Vogel
•like this
Philipp Holzer and Roland Häder like this.
Friendica Admins reshared this.
Roland Hรคder
•https://
? That's never a good idea.Friendica Admins reshared this.
Philipp Holzer
•seems to work : https://friendica.philipp.info/avatar/4c/a1/d7c/53/8b/f08b/cd3c2904ac0bfd56-300.png?ts=1682970014
This image is now served by a completely different nginx than the frontend nginx . Because it's stateless, I'm now able to start more nginx for "just" serving stateless static content!
Brilliant!
Friendica Admins reshared this.
Michael Vogel
•Philipp Holzer likes this.
Friendica Admins reshared this.
Philipp Holzer
•Michael Vogel likes this.
Friendica Admins reshared this.
Philipp Holzer
•avatar/
, there are still a lot of long running requests, see the image above. Do you have any idea? The overall CPU/RAM is on a normal state.