Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bestpractical/rt-extension-log-memoryusage
https://github.com/bestpractical/rt-extension-log-memoryusage
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bestpractical/rt-extension-log-memoryusage
- Owner: bestpractical
- Created: 2009-10-21T22:34:37.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2010-04-14T12:47:06.000Z (over 14 years ago)
- Last Synced: 2023-04-13T18:31:29.236Z (over 1 year ago)
- Language: Perl
- Homepage: http://search.cpan.org/dist/RT-Extension-Log-MemoryUsage
- Size: 121 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
NAME
RT::Extension::Log::MemoryUsage - log information about memory used by
RT processesSYNOPSIS
# in RT site config# register plugins
Set( @Plugins, qw(
... other plugins ...
RT::Extension::Log::MemoryUsage
));
Set(@MasonParameters,
plugins => [qw(RT::Extension::Log::MemoryUsage::MPL)],
);# setup logging to see messages
Set( $LogToScreen, 'info');
# or
Set( $LogToSyslog, 'info');DESCRIPTION
This extension helps identify requests that cause a memory usage spikes.RT is a big application with many modules, extensions and different ways
to run system. As well, there are tons of ways to screw up memory usage.
It's hard to detect memory leaks and not only them, but just places in
code that like to eat lots of memory. This extension reports memory
usage changes after each request to the server. Unix `ps` command is
used to get this information.INSTALLATION
perl Makefile.PL
make
make installChange RT site config according to "SYNOPSIS", restart server.
RESULTS
When RT handles a request this plugin logs two messages. Before the
request and after. Something like:memory after '/index.html' =>
pid: 25956; rss: 55380 (+20); rsz: 55380 (+20);
vsz: 129168 (+144); tsiz: 0; %mem: 2.6;
memory before '/index.html' =>
pid: 25956; rss: 55360 (-20); rsz: 55360 (-20);
vsz: 129024 (-144); tsiz: 0; %mem: 2.6;Message issued before request shows change in memory usage since
previouse request to this process. Usually it shows negative numbers,
except for request after first touch of a component. Negative numbers is
a result of taking sample a little bit earlier after request when some
memory is not freed yet, but it is free before next request. As you can
see above in example all additional memory was freed between requests.When a page requested for the first time then usually numbers don't
match. This happens cuz perl have to compile new code and that code
stays in the system for the whole time.However, if you have a page X and constantly next request doesn't
reclaim all memory before then you have a memory leak.AUTHOR
Ruslan ZakirovLICENSE
Under the same terms as perl itself.