• Moderator Bet Hannon

    (@bethannon1)


    This KB article at Media Temple suggests using strace to find problem plugins, by running this command from the WP root directory:

    strace php5 index.php 2>&1 | perl -ne 'if (/plugins\/([\w\d-_]*)/ ) { print "$1\n" }' | sort | uniq -c | sort -n

    I haven’t been able to get it to work, and MT suggests that it might be that “index.php” isn’t right (but that’s all the further their support can go), and that perhaps something in the WP has changed and this command is no longer right.

    I’m not able to find anything in Google searches about using strace in this way. Has anyone done this, and more importantly, is it helpful info? If anyone has a tweak to the command that would help, I’m interested.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator James Huff

    (@macmanx)

    Is it perhaps possible that your server has restricted access to strace?

    Have you considered trying https://www.ads-software.com/plugins/p3-profiler/ instead?

    P3 was developed by GoDaddy just for this, and MediaTemple is technically GoDaddy now, so I don’t see why that wouldn’t work. ??

    Moderator Bet Hannon

    (@bethannon1)

    Hi James!

    They may have it restricted, although their KB article suggests using it on their grid server, so I would think that those two things wouldn’t conflict. But stranger things have happened.

    I’m trying to work with a multisite network, and P3 only seems to be accessible from individual sites. Not sure if strace would do any better, but I wondered if it would.

    Thanks, James!

    Moderator James Huff

    (@macmanx)

    It should be better, though a lot less graphical.

    I recommend getting in touch with MT, as either strace is broken, or their documentation is wrong.

    I just tried the above strace as root on on of my servers + had this output…

    net4-dev# strace php5 index.php 2>&1 | perl -ne ‘if (/plugins\/([\w\d-_]*)/ ) { print “$1\n” }’ | sort | uniq -c | sort -n
    1 wp-security-audit-log-en_US
    1 wp-useronline-en_US
    5 plugin-notes
    5 theme-check
    5 wp-fail2ban
    8 duplicator
    13 heartbeat-control
    48 wp-spamshield
    105 wp-useronline
    355 wp-security-audit-log

    And all this provides is number of times a plugin is called per page render.

    For something like determining amount of memory increase per php call, try using XDebug’s Trace Execution facility for things like times each function is called or memory usage increase per each function call.

    plugins to trace errors are quite sluggish,
    i suggest you do a simple php runE to really decode.
    For the JS parts – if you did – i don’t know, any suggestion?

    same for JS calls, WP is quite bad at that with all you can put on top of it on the front-end site – with many duplicate js calls that often kills performance. A new relic plugin is very op for monitoring performance of that.

    there are also some plugins that do pure page serving performance like wp-rocket, i guess you could give it a try (many testimonials are very good on large scale deployments).

    If you run a debian/ubuntu, you could also try commands like:

    /top
    /uptime
    /memtop
    cat /proc/meminfo

    Because often performance is on the long run, checking uptime is interesting, not only a single break or so. If you do run a good server, uptime is interesting. Memtop/meminfo will show you what’s busying things. Top more on cpu side.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘use strace to find plugin issues?’ is closed to new replies.