Jump to content

Recommended Posts

Hi there,

while developing a sideproject which is completly build with ProcessModules i suddenly had the urge to measure the performance of some modules ūüėȬ†as a result, say welcome to the FlowtiAppPerformance module.¬†

It comes bundled with a small helper module called FlowtiModuleProfiler. In the first release, even though you could select other modules, it will track the execution of selected Site/ProcessModules. 
This will give you the ability to gain insights how your Application behaves. 

The Main Module itself will come with 2 Logging Options, Database or PW Logs. Select Database for Charts and Logs...well If you just want your profiles as a simple log file in PW. 
You also could choose to dump the request profile into TracyDebugger as shown here:

2024173241_image(2).png.a187c63e36660118b9d6e8df6b2ce962.png

Dont wonder about my avg_sysload, somehow my laptop cant handle multiple VMs that good ūüėĄ

Settings Screen

532755926_image(3).thumb.png.7cc88ab079acf3b010f3363101f177f5.png

Monitoring

1284118673_image(4).thumb.png.9faeb2372d4351ca636751ce8fb5cb7d.png

FlowtiLogs

917266405_image(5).thumb.png.5c2c47f5fb2a75dbd2ba9305144121ab.png

again, dont look at the sysload ūüėĄ

I will update the Module in the future to give some filter options and aggregation, but for now it satisfies my needs. 
I hope it is helpfull for some. 

Module is submited to the directory and hosted at github
https://github.com/Luis85/FlowtiAppPerformance

Any suggestions, wishes etc. are much appreciated. 

 

Cheers,

Luis

  • Like 12

Share this post


Link to post
Share on other sites

Pushed Version 0.1.1

- added new PageRender Timer (tracks just the page->render() time)
- cleaned Profile Dump
- JavaScript refactored (was a mess before #SundayEvening)
- added new ProfileName Method to avoid duplicate entries


1820782740_image(6).png.d6aa383ecd428acbdd3eeb7431cedae3.png

 

Still TODO

- Filter / Limiting / Aggregation of logged datasets
- more tracking options
- maybe add a webhook to feed other services, will see

Share this post


Link to post
Share on other sites

@bernhard¬†Im well aware of profiler-pro ūüôā¬†

I am a ProcessWire fanboy since 2014 but unfortunatly¬†lost my forums account ūüė쬆maybe some old veterans remember me.¬†

Anyways, why do I replicate the pro module you may ask, good question. I have a lot of small PW Instances running for various reasons and dont see the need to purchase a module for my profiling needs. 
Usually my instances are running solely on the ProcessWire Admin because the time I did websites are long gone.
This in mind there are times I want to see how a specific module I my application runs. 

How do I achieve this? 
The core class ProcessController exposes the hookable Method ::execute.
If your site is in Debug=true you already get timers before and after the method call which is totally fine, but once in production I want to avoid setting the site into debug mode just to get these timings.

So we add 2 Hooks to ::execute

$this->addHookBefore("ProcessController::execute", $this, 'startProfiler');
$this->addHookAfter("ProcessController::execute", $this, 'startProfiler');

This gives us also the ability to enrich our profiling with some more data like the requests memory_peak_usage or the avg_sys_load for the last minute. 

These are the 2 values I am the most interested in because they will provide me enough data to see bottlenecks not only on a custom Process Module but also on a specific method. 

For example

 594340674_image(7).thumb.png.b909b10988b0213732e4ea2e487f7418.png

this dataset will give me the opportunity to track down a single method in one Class to inspect the code if there is something fishy. 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@teppo¬†thanks for the mention in the last Weekly, much appreciated ūüôā

I recently pushed a new Version to Github and changed the MarkupTables with DataTables. 

I am well aware that the module isnt that polished someone might expect. I more or less hacked it together to fullfill some very specific needs I had. 
But, I plan to work on it from time to time.

One thing which came to my mind was to integrate the recently published LogStash Module. 
Im always open for suggestions ūüôā

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Cl√©ment Lambelet
      Hey!
      I've been working on a Processwire installation (3.0.123) for a few days now and I must have made a big mistake this morning because the links in the admin's main menu no longer appear.
      This is not related to the admin theme, because the bug occurs with all themes (Default, Reno, Uikit).
      I tried to reinstall with the dev version (3.0.136), but the problem is still there. I also uninstalled all the modules I had added, without success. There is no error in the js console. 
      I still can access/view/edit the pages  by going through the admin/page list.
      Thanks in advance for your help!


    • By iipa
      Hi!
      I have two Page Reference fields: Category and Subcategory. Category is parent of Subcategory, and can have 0 to n Subcategories. Fields are selected by dropdown selection.
      I'm trying to achieve following logic:
      1. Select Category (obviously works)
      2. Change Subcategory options based on selected Category (this works)
      3. Hide the Subcategory field if Category has no Subcategories (to prevent weird dropdown with nothing to select)
      I have tried to investigate two possible alternatives to achieve step 3:
      A) Make dynamic condition into Subcategory selection's "Only visible if..." field
      B) Make a hook that fires when Category changes, then hides Subcategory field if Category has no children
      So far I haven't been successful in either. Conditions I've tried always lead to hidden field, and I haven't been able to find set up a hook that fires on field change.
      So here's the question (finally): Is there a way to alter field visibility in API, for example in ready.php or inside a hook? In API I could loop through categories, find the ones that have children and then make a selector based on their IDs.
    • By Mobiletrooper
      Hey Ryan, hey friends,
      we, Mobile Trooper a digital agency based in Germany, use ProcessWire for an Enterprise-grade Intranet publishing portal which is under heavy development for over 3 years now. Over the years not only the user base grew but also the platform in general. We introduced lots and lots of features thanks to ProcessWire's absurd flexibility. We came along many CMS (or CMFs for that matter) that don't even come close to ProcessWire. Closest we came across was Locomotive (Rails-based) and Pimcore (PHP based).
      So this is not your typical ProcessWire installation in terms of size.
      Currently we count:
      140 Templates (Some have 1 page, some have >6000 pages)
      313 Fields
      ~ 15k Users (For an intranet portal? That's heavy.)
      ~ 195 431 Pages (At least that's the current AUTOINCREMENT)
       
      I think we came to a point where ProcessWire isn't as scalable anymore as it used to be. Our latest research measured over 20 seconds of load time (the time PHP spent scambling the HTML together). That's unacceptable unfortunately. We've implemented common performance strategies like:
      We're running on fat machines (DB server has 32 gigs RAM, Prod Web server has 32gigs as well. Both are running on quadcores (xeons) hosted by Azure.
      We have load balancing in place, but still, a single server needs up to 20 sec to respond to a single request averaging at around about 12 sec.
      In our research we came across pages that sent over 1000 SQL queries with lots of JOINs. This is obviously needed because of PWs architecture (a field a table) but does this slow mySQL down much? For the start page we need to get somewhere around 60-80 pages, each page needs to be queried for ~12 fields to be displayed correctly, is this too much? There are many different fields involved like multiple Page-fields which hold tags, categories etc.
      We installed Profiler Pro but it does not seem to show us the real bottleneck, it just says that everything is kinda slow and sums up to the grand total we mentioned above.
      ProCache does not help us because every user is seeing something different, so we can cache some fragments but they usually measure at around 10ms. We can't spend time optimising if we can't expect an affordable benefit. Therefore we opted against ProCache and used our own module which generates these cache fragments lazily. 
      That speeds up the whole page rendering to ~7 sec, this is acceptable compared to 20sec but still ridiculously long.
      Our page consists of mainly dynamic parts changing every 2-5 minutes. It's different across multiple users based on their location, language and other preferences.
      We also have about 120 people working on the processwire backend the whole day concurrently.
       
      What do you guys think?
      Here are my questions, hopefully we can collect these in a wiki or something because I'm sure more and more people will hit that break sooner than they hoped they would:
       
      - Should we opt for optimising the database? Since >2k per request is a lot even for a mysql server, webserver cpu is basically idling at that time.
      - Do you think at this point it makes sense to use ProcessWire as a simple REST API?
      - In your experience, what fieldtypes are expensive? Page? RepeaterMatrix?
      - Ryan, what do you consider as the primary bottleneck of processwire?
      - Is the amount of fields too much? Would it be better if we would try to reuse fields as much as possible?
      - Is there an option to hook onto ProcessWires SQL builder? So we can write custom SQL for some selectors?
       
      Thanks and lots of wishes,
      Pascal from Mobile Trooper
       
       
    • By mr-fan
      What i wanna achive is a simple counter like that count up on visit (this is no problem) AND save the specific date (year/month/day) of the count...
      in the end i will be able to get visits per day/per month/per year in a nice and dirty graph.
      Just to have a way better simple counter system.
      Should i only go with a complex setup of pages like this:
      --stats (home template for pageviews)
      ----2018 (year)
      ------08 (month)
      ---------29 ->page_views   (integers on every day template)
      ---------30 ->page_views
      Or just simple use:
      --stats (home template for pageviews)
      ---->count (template) that holds simple field page_views and a date field
      or could a fieldtype like tables (one table field for every month/year or so) be also a solution?
      Or a own SQL table special for this and use it in a module? I don't have any experience on this topic...
      What i have in mind of performance sideeffects on such a thing?
      Or is there a solution that works with PW?
      I wanna go the hard way and implement something like this:
      http://stats.simplepublisher.com/
      only directly within PW and use the API to get the data...maybe create a simple module from it later i don't know if i¬† could set it up right from the start ūüėČ
      this is the reason for my questions on more experienced devs
      Kind regards mr-fan
       
    • By FrancisChung
      Long but well written, detailed and informative article written by an Engineering Manager for Google Chrome about the true cost of Javascript and what you can do to alleviate some of that cost.
      Must read!

      https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4
√ó
√ó
  • Create New...