Body: <p>I am evaluating a few different CMS solutions for my company's new website. Everything about Craft looks great according to my research. After installing version 3 onto an Azure App Service Linux instance I'm growing concerned about the viability, though, due to poor performance. The control panel is taking at least 4 seconds TTFB regularly. The &quot;Welcome Thanks for installing Craft CMS!&quot; default page is taking about 3 seconds TTFB consistently.</p>
  <p>I've ensured I followed the installation and setup steps properly. I've ruled out a network issue. I've run the installation in an App Service plan that far exceeds what should be required for even moderate performance. After running the (very awesome) diagnostic tool it seems that the twig rendering is mostly to blame, although my DB queries aren't running as quickly as I would hope. That might just be due to an undersized MySQL instance on Azure. I can deal with that if I get the more blatant twig issues resolved.</p>
  <p>I've run non-Craft php web pages from the instance and they return very quickly, sub 100ms. So I don't think the php or webserver installation that Azure provides is fundamentally bad. I'm banging my head against the wall at this point. Can someone shed any light on next steps? I really want Craft to be an option for our new platform, but I can't sell it to the stakeholders unless I can make it significantly more performant.</p>
  <p>Thanks for any help you can offer.</p>
  <p>Please see the performance results below.</p>
  <p><strong>Application Info</strong></p>
  <ul>
  <li>PHP version  7.4.9</li>
  <li>OS version   Linux 5.4.0-1031-azure</li>
  <li>Database driver &amp; version    MySQL 5.6.47.0</li>
  <li>Image driver &amp; version   Imagick 3.4.4 (ImageMagick 6.9.10-23)</li>
  <li>Craft edition &amp; version  Craft Pro 3.6.4.1</li>
  <li>Yii version  2.0.40</li>
  <li>Twig version v2.14.3</li>
  <li>Guzzle version   7.2.0</li>
  </ul>
  <p><a href="https://i.sstatic.net/pFYm4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pFYm4.png" alt="CP Performance" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-10T16:13:53.380Z
Comments.Text: Do you have the xdebug extension installed on the server? That will slow things down significantly.
Comments.UserDisplayName: Luke Holder
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-10T16:25:53.410Z
Comments.Text: Thanks for the suggestion. xdebug is not installed. I confirmed by checking for it in the output of "php -m -c" from the console.
Comments.UserDisplayName: Doug Hill
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-15T20:43:52.057Z
Comments.Text: Looks like slow compute? Is opcache enabled? devmode can obviously slow things down as well. I have a small passing knowledge of Azure App service but theoretically you could also try using one of their prebuilt WordPress containers as a starting point and point your Craft install at that.
Comments.UserDisplayName: RitterKnight
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-16T15:22:07.103Z
Comments.Text: Ritter - opcache is enabled. Toggling devmode has no impact. I'm actively working through this with Craft Support and will hopefully have a resolution this week.
Comments.UserDisplayName: Doug Hill
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-27T13:01:52.250Z
Comments.Text: @DougHill Did you find any satisfactory solutions or mitigations to the performance issues?
Comments.UserDisplayName: Nils
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-04-28T16:55:41.093Z
Comments.Text: @Nils - Craft support wasn't able to reproduce the issue. The only differences we had was the Azure region we were deployed to. I was in East1, they were testing in West. I simply rebuilt my instance in the West region and all was well. Just to make sure I wasn't going crazy, I rebuilt a few times from scratch in East1 and I was able to reproduce the performance issues every time. Very strange, but I didn't spend anymore time researching.
Comments.UserDisplayName: Doug Hill
Tags: <craft3><templating>
Title: Why is my base installation of Craft 3 so slow on Azure App Services?
ThreadText: # Why is my base installation of Craft 3 so slow on Azure App Services?
  
  (Asked by: username_0 on 2021-02-10)
  
  I am evaluating a few different CMS solutions for my company's new website. Everything about Craft looks great according to my research. After installing version 3 onto an Azure App Service Linux instance I'm growing concerned about the viability, though, due to poor performance. The control panel is taking at least 4 seconds TTFB regularly. The "Welcome Thanks for installing Craft CMS!" default page is taking about 3 seconds TTFB consistently.
  
  I've ensured I followed the installation and setup steps properly. I've ruled out a network issue. I've run the installation in an App Service plan that far exceeds what should be required for even moderate performance. After running the (very awesome) diagnostic tool it seems that the twig rendering is mostly to blame, although my DB queries aren't running as quickly as I would hope. That might just be due to an undersized MySQL instance on Azure. I can deal with that if I get the more blatant twig issues resolved.
  
  I've run non-Craft php web pages from the instance and they return very quickly, sub 100ms. So I don't think the php or webserver installation that Azure provides is fundamentally bad. I'm banging my head against the wall at this point. Can someone shed any light on next steps? I really want Craft to be an option for our new platform, but I can't sell it to the stakeholders unless I can make it significantly more performant.
  
  Thanks for any help you can offer.
  
  Please see the performance results below.
  
  **Application Info**
  
  * PHP version 7.4.9
  * OS version Linux 5.4.0-1031-azure
  * Database driver & version MySQL 5.6.47.0
  * Image driver & version Imagick 3.4.4 (ImageMagick 6.9.10-23)
  * Craft edition & version Craft Pro 3.6.4.1
  * Yii version 2.0.40
  * Twig version v2.14.3
  * Guzzle version 7.2.0
  
  [![CP Performance](https://i.sstatic.net/pFYm4.png)](https://i.sstatic.net/pFYm4.png)
  
  **Tags:** craft3, templating
  
  > **Comments:**
  > **username_1**: Do you have the xdebug extension installed on the server? That will slow things down significantly.  
  > **username_0**: Thanks for the suggestion. xdebug is not installed. I confirmed by checking for it in the output of "php -m -c" from the console.  
  > **username_2**: Looks like slow compute? Is opcache enabled? devmode can obviously slow things down as well. I have a small passing knowledge of Azure App service but theoretically you could also try using one of their prebuilt WordPress containers as a starting point and point your Craft install at that.  
  > **username_0**: Ritter - opcache is enabled. Toggling devmode has no impact. I'm actively working through this with Craft Support and will hopefully have a resolution this week.  
  > **username_3**: @username_0 Did you find any satisfactory solutions or mitigations to the performance issues?  
  > **username_0**: @username_3 - Craft support wasn't able to reproduce the issue. The only differences we had was the Azure region we were deployed to. I was in East1, they were testing in West. I simply rebuilt my instance in the West region and all was well. Just to make sure I wasn't going crazy, I rebuilt a few times from scratch in East1 and I was able to reproduce the performance issues every time. Very strange, but I didn't spend anymore time researching.  
  
  ---
  
  ## 0 answers
  
  