Dependency Graph
View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0013680 | mantisbt | performance | public | 2011-12-15 05:22 | 2014-12-22 08:23 |
Reporter | JanHegewald | Assigned To | dregad | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 1.2.13 | Fixed in Version | 1.2.13 | ||
Summary | 0013680: Configuration page takes a very long time to load | ||||
Description | Loading the configuration page (adm_config_report.php) takes a very long time, for example I have got 1,394 configuration entrys in mantis_config_table and the page loads for over 60 seconds. Is there a way to reduce this loading duration? | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
related to | 0012113 | closed | dregad | Configuration Report should be located somewhere else in the web interface |
related to | 0015721 | closed | grangeway | Functionality to consider porting to master-2.0.x |
related to | 0014559 | closed | dregad | Adding filter for "Configuration report" |
related to | 0015347 | closed | dregad | Bad performance and memory issue with print_user_option_list |
Additional information: this happens on 1.2.1. And my php log tells me, that most of the time the problem is because of this line in session_api.php (line 154): $_SESSION[ $this->key ][ $p_name ] = serialize( $p_value ); Edit: removed typo |
|
Can you share the contents of your config table? Alternatively, please attach the result of loading the page with xdebug profiling enabled ( http://xdebug.org/docs/profiler ). |
|
I attached an output file of xdebug profiler. Because the file has a size of around 34 MB, I had to pack it. I hope this is ok. One additional information: every time I reload the page, it gets slower. It's slowing down approx. 2 to 5 seconds per reload. When I close the browser (Firefox 8.0), wait for some time, open the browser again and reopen the config page, it loads very much faster (around 5 secondes for the first time, I think). |
|
Thanks for the profiling output. It seems that printing a button ( for each modified configuration option ) triggers a lot of work behind the scenes, which creates performance problems. I do not have an immediate solution, but I'll target this towards 1.2.x . |
|
Thanks for your feedback! Edit: it seems that commentig out the lines in adm_config_report.php where the button is generated fixes the issue temporary. Now the duration for page load is constant or even decreasing a little bit. I know that this is just a temporary solution, but for now it's perfect for me. Again, thanks for investigating! |
|
Maybe another workaround: |
|
The bottleneck is actually the serialize/unserialize calls performed while storing/retrieving the token from the PHP session. Maybe we could shift to json encoding to improve performance ? https://bugs.php.net/bug.php?id=51267 |
|
Our CSRF support at present is far from being user friendly or sane from a performance perspective. There is no reason why we need multiple CSRF tokens per page load. We don't even need a unique CSRF token for each page load. This is something we need to fix in a future release. |
|
@dhx I suppose you were referring to https://github.com/mantisbt/mantisbt/commit/a45d0ef551e9359d3a469287f5de8ef08096e12f ? |
|
I have implemented basic filtering on the manage config page which I believe would be an effective workaround for the performance issue reported here, thanks to the default filter criteria. Please have a look at https://github.com/dregad/mantisbt/tree/manage-config - testing and feedback would be appreciated. |
|
Reminder sent to: dhx @dhx, I made an attempt at fixing this issue [1] and would appreciate if you could take a look at the changes I made. Let me know what you think. |
|
@dregad: Thanks for the reminder and proposed patch. I've reviewed https://github.com/dregad/mantisbt/commit/db0e3d3b103750197cbc656323ff2984f803fa47 and it looks good to commit. Keep up the good work :) |
|
Thanks for feedback dhx. For the record, I did some benchmarking for this patch, using a sample DB having a bit less than 700 records in mantis_config_table, configuring the filter as appropriate to display all of them, for the following branches: baseline: current 1.2.x branch HEAD (commit 66050dc2) Average execution times on 3 runs (as reported at page bottom by $g_show_timer) are as follows: baseline: 13.3 seconds I have a bit more testing to do on other aspects of the feature branch https://github.com/dregad/mantisbt/tree/manage-config before merging. |
|
Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch |
|
MantisBT: master-1.2.x 259f95cd 2012-12-14 10:10 Details Diff |
Issue 0014559: improve adm_report_config.php filter The following changes were made - revised UI to make it more similar to the issues filter - make use of existing constants and language strings - filter defaults to All Users / All Projects / All options which avoids performance issues in installations having a large number of entries in the config table (workaround for issue 0013680) - filter form uses post instead of get method - comply to coding guidelines |
Affected Issues 0013680, 0014559 |
|
mod - adm_config_report.php | Diff File | ||
mod - lang/strings_english.txt | Diff File | ||
mod - lang/strings_french.txt | Diff File | ||
MantisBT: master-1.2.x db0e3d3b 2013-01-02 08:13 Details Diff |
Fix performance issue on adm_config_report.php In systems with large numbers of config items in mantis_config_table, the Configuration Report page can take a very long time to load. This behavior is due to each of the 'Delete' buttons being printed with its own form, each one having a security token. The performance bottleneck is actually the serialize/unserialize calls executed while storing/retrieving the token from the PHP session. To avoid this problem, the print_button() and form_security_field() functions have been modified to accept a security token as an optional parameter. This allows the calling page to generate a single token, which is shared by all buttons. Furthermore, print_button() also allows the security token parameter to be 'OFF', which prevents the function from displaying a security field. This is useful for buttons not resulting in modifications (i.e. not requiring CSRF protection). Fixes 0013680 |
Affected Issues 0013680 |
|
mod - adm_config_report.php | Diff File | ||
mod - core/form_api.php | Diff File | ||
mod - core/print_api.php | Diff File | ||
MantisBT: master 5c3ac412 2013-01-02 08:13 Details Diff |
Fix performance issue on adm_config_report.php In systems with large numbers of config items in mantis_config_table, the Configuration Report page can take a very long time to load. This behavior is due to each of the 'Delete' buttons being printed with its own form, each one having a security token. The performance bottleneck is actually the serialize/unserialize calls executed while storing/retrieving the token from the PHP session. To avoid this problem, the print_button() and form_security_field() functions have been modified to accept a security token as an optional parameter. This allows the calling page to generate a single token, which is shared by all buttons. Furthermore, print_button() also allows the security token parameter to be 'OFF', which prevents the function from displaying a security field. This is useful for buttons not resulting in modifications (i.e. not requiring CSRF protection). Fixes 0013680 |
Affected Issues 0013680 |
|
mod - adm_config_report.php | Diff File | ||
mod - core/form_api.php | Diff File | ||
mod - core/print_api.php | Diff File |