![]() |
[How to] Cut down on memory usage
This is in the manual but I've yet to see it mentioned here.
Quote:
|
Would this slow execution if lots of plugins were calling lots of files ?
|
Quote:
The bulk of my processing is done via external files. |
Quote:
I think files modifications would be better for this purpose |
I have been thinking about creating an extension that will allow 'include-files' for plugins. They would be loaded as regular plugins (not file uploads), and can be loaded into memory whenever needed (for example: require_pluginlibrary_once('myfunctionlibraryplugi n'); ).
Like this you might get the best of both worlds: - No file uploads - Only loaded into memory when needed |
I like that concept, I think I am going to play with this some more.
|
i'm ditching the plugin system on most of my larger sites. I'm just hardcoding the hacks. The plugin system is great in principal, but it eats up memory, increases queries, and slows down execution.
|
Quote:
|
Quote:
|
Quote:
|
Just having the plugin system turned on uses extra queries. A good programmer ca hack vbulletin in such a way as to add few if any extra queries, but the system itself is what adds the extra queries.
Quote:
|
Quote:
Remember that the number of queries is almost irrelevant for performance, it is the execution time that counts. |
Seems to me that just putting the plugin code in a php file and replacing it with
include('./plugins/my_script.php'); Doesn't work 100% |
Nobody ever said that things would work without any modification.
|
1. Turning the Plugin System On or Off does not have any impact on the amout of queries.
2. Memory Footprint is not a such a big issue. In most cases, forumcache (which is loaded on every page) for example will be a lot bigger then the plugins. Having to eval() the code all the time, that is an issue. Therefore, complex plugin code (especially in high-traffic places like global.php, postbit, showthread, forumdisplay, etc.) should be moved out to include files. (Could even be done automatically. I wrote a proof-of-concept hack that writes include-files if the plugin-code on one hook is > X bytes long.) |
Quote:
If you use PHP Code:
|
Quote:
And then estakis referral stats. That one works, half way. It's depositing all the code in raw format on the page. Crazy I tell ya. |
Erm ... are you sure you put
Code:
<?php |
Quote:
|
|
I have a problem with include's and phrases. It has been recreated in the files test.php and includes/test_include.php.
The problem is that the code is executed and the template fetched, but the phrase is not being printed. The nature of the real script means that I cannot use another plugin to insert the code, so that is out of the question. Any ideas on how to do this properly? test.php: PHP Code:
PHP Code:
HTML Code:
<tr> |
I just added about 10 of my larger plugins to files, and I have noticed a considerable lag on the forum. Page generation times have increased from .10 seconds to 2 seconds or more, and server load has gone up from about 1.00 to anywhere from 8 - 40. 40!!!!!
EDIT: Looks like it was just a really bad night for server load. My forum seems to be running at the normal load today. |
Do you still believe that outsourcing hugh plugins to includes will speed up your forum?
I don't think so. It sounds like it should improve the performance, but in real scenarios, it doesn't matter. At least, have a look in the official addons like the blog software. They put their code in the plugins and not in files they include. They did it with high traffic hooks like fetch_userinfo... Haven't they thought about performance or doesn't that matter... |
All times are GMT. The time now is 04:51 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|