Code analysis in production

Asked

Viewed 49 times

1

Hello,

I wonder if there is any open source tool for me to analyze memory/processing usage allocated by my methods in production.

I would like to know what methods need attention and improvements, and so decrease the use of resources by my applications.

My production environments are composed of php-5.6 or php-7 (depends on the application), Nginx as reverse proxy, Apache2 behind NGINX (by limitations on some applications) and Linux (Ubuntu/Centos) as S.O.

  • 2

    You can see some information with the Xdebug (free) and the Blackbird (paid) both make Profiling.

  • In the case of XDEBUG it will not slow down my application?

  • 2

    Any profiler will make your application (maybe even) slow, you run only to detect the bottlenecks then turn off, make the proper modifications and turn on again to see whether or not it has effected.

  • Oh yes I understood, I thought there could be something like Sentry (which makes analysis of errors) so that it could be turned on in production without affecting performance... (but I found it very magical in the case of the Profiling) I will do some tests.

  • In the case of Xdebug, you run that chunk of code and it measures how long each operation (called methods/functions) took to be performed and amount of mémoria allocated. Then it generates a file with this information is necessary another tool to analyze this log, the webgrind is an example there are other options.

  • 1

    Open-Source don’t know. There is Newrelic and the like, which monitor the whole server and the application. It is able to list the average response time, which were the slowest and why were, which function took the most time to be processed, even the query that took to be processed and, of course, also reports execution errors... It can usually be kept on "forever". However it is paid.

Show 1 more comment

1 answer

0

But in case, you need to measure peak access on these Web Servers, with rrdtool, Cacti + mrtg, you will get the graphics of these accesses.

Then you have the disk speed and amount of ram memory and size and amount of database access.

When you have these charts you will get an idea of the general context that is occurring on the Server as a whole, try starting from that point first.

Of course this was a suggestion, my who took care for almost 10 years of hosting environments, I hope you can help, any doubt I am available.

  • Hello Nilton, but I would like to id identify bottlenecks in my sample code (my setPontulation method allocates x memory takes on average x time to run) based on this I can improve my codes

Browser other questions tagged

You are not signed in. Login or sign up in order to post.