User tests: Successful: Unsuccessful:
Sites with many articles (>20K, in our case), can produce server overloading with urls like http://example.org/inexistent-category/inexistent-alias-without-id-prefix
With this fix, we are checking the category before sending the articles query ( $items = $this->get('items') )
Labels |
Added:
?
|
Hi @Kubik-Rubik ! Thanks for your response ...
It's true, in https://github.com/silvioq/joomla-cms/blob/staging/components/com_content/models/category.php#L234 valid category is checked, but in our case, in libraries/legacy/view/category.php, $this->get('category') is ROOT, but $this->get('parent') is false ... maybe there are a data trouble?
Regards!
EDIT: $this->getCategory() returns ROOT in category model, line 234
Category | ⇒ | Libraries |
Hi @Kubik-Rubik!
The patch is in production since 20 days ago, and the server overload didn't produce again ... What do you think about it?
can you give me a testinstruction?
@silvioq Could you please provide some clear test instructions so also the non technical user can test the patch?
Thanks!
Hi @RickR2H ! For an adequate test, the steps are
The 404 error is returned much more fast, because in the main branch, all jos_content intems are read.
UPDATE:
I don't know if the issue is generated by our particular data, but the patch has been avoiding server overload problems since March 2015
@joomlamarco and @RickR2H can you guys please test? Thanks.
I have tested this item
I tested this patch @icampus PBF and it seemed to fix the issue for me. Tested on a local test server on Windows 7 with Firefox. I inserted 10000 test articles into the content table of the database and tried to call http://localhost/bugtesting/index.php/inexistent-category/inexistent-alias-without-id-prefix. Before the fix it took a long time to load and display an error and after applying the fix it immediately displayed the 404 Category not found error.
@kevinscheithauer how did you insert 10k articles?
@rdeutz you can use https://github.com/nikosdion/com_overload
@brianteeman I know, my intention was to check how valid the successful test is
Ah - ok ;)
I did it with an insert sql statement where I put the values from an article that I created manually via the backend. To be completely honest I didn't know that there was a component for this kinda stuff. Will try it again with the component soon to check if it makes a difference.
I have tested this item
tested successfully @icampus
The patch is working for me. I inserted 10000 entries and testet the url. The error appeared ( memory error).
After the fix it's working fine.
Status | Pending | ⇒ | Ready to Commit |
RTC as we have 2 successful tests
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-13 17:44:07 |
Closed_By | ⇒ | wilsonge |
Labels |
Removed:
?
|
Hi @silvioq,
if the category is not correct, then no items are loaded (see function getItems in components/com_content/models/category.php) anyway. The category is already checked in line 234 ($category = $this->getCategory()), so the change in the process ordering does not improve the performance (I did not check the pagination call though.).
Can you explain in more detail why your PR will improve the performance?