perftools / xhgui

Web interface for XHProf profiling data can store data in MongoDB or PDO database
1.65k stars 341 forks source link

Increase `client_max_body_size` to 5 MB #475

Closed mpdude closed 2 years ago

mpdude commented 2 years ago

The default client_max_body_size is 1MB and may be too low for more complex data submissions. IMHO, increasing it to 5M should not do too much harm resource-wise.

Since the PHP Profiler silently discards errors when uploading data (here), it is not obvious for newcomers to understand why data does not show up. Thus, I think avoiding background errors like 413 is important.

glensc commented 2 years ago

Thus, I think avoiding background errors like 413 is important.

please explain what is that

mpdude commented 2 years ago

Sorry, that was really badly explained.

Specifically, I was referring to the Docker image and the docker-compose.yml configuration provided in this repo. When the data submitted to XHGui (the body of the POST request) exceeds 1 MB in size, Ngnix will reject the request with an 413 – Request Entity Too Large error message. Raising this 1 MB limit is what this PR is about.

What I meant with "in the background" is that in your code, you'll usually add some lines of code using perftools/php-profiler to collect data and send it to XHGui. You don't really see or deal with this HTTP request submitting the data, and you also don't see the error message unless you search for it. As a user of XHGui, I see some of my requests showing up in the database, others not.

My suggestion is to avoid this kind of pitfall for unexperienced XHGui users (like I am).

Does that make more sense @glensc?

glensc commented 2 years ago

All is well explained except that magic number 413 was unclear.