index.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?xml version="1.0"?>
  2. <!-- File name: index.xml (tuning)
  3. BSD 3-Clause License
  4. Copyright (c) 2021, 2024, 5 Mode
  5. All rights reserved.
  6. Redistribution and use in source and binary forms, with or without
  7. modification, are permitted provided that the following conditions are met:
  8. 1. Redistributions of source code must retain the above copyright notice, this
  9. list of conditions and the following disclaimer.
  10. 2. Redistributions in binary form must reproduce the above copyright notice,
  11. this list of conditions and the following disclaimer in the documentation
  12. and/or other materials provided with the distribution.
  13. 3. Neither the name of the copyright holder nor the names of its
  14. contributors may be used to endorse or promote products derived from
  15. this software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  20. FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  21. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  22. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  23. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. -->
  27. <?xml-stylesheet type="text/xsl" href="tuning.xsl"?>
  28. <CONTENT>
  29. <ITEM>
  30. <ID>4</ID>
  31. <DATE>Sat October 16th 2021</DATE>
  32. <TITLE>The oracle to my code secrets</TITLE>
  33. <BODY><![CDATA[
  34. PHP language is continuosly evolving and assimilating new functionalities becoming more fast too. Beside this it is nice to have good coding practices and profiling tools to tune your own PHP code: Webgrind is surely the tool that needs to be in your coding bag. It is a web app, written in PHP, easy to deploy and easy to understand (that is never too bad); it makes use of Xdebug under the cover.
  35. ]]></BODY>
  36. <SEE>Webgrind</SEE>
  37. <SEEURL>http://github.com/jokkedk/webgrind</SEEURL>
  38. <TYPE>tip</TYPE>
  39. <CAT>tuning</CAT>
  40. <INDEX>1</INDEX>
  41. </ITEM>
  42. <ITEM>
  43. <ID>6</ID>
  44. <DATE>Sat October 16th 2021</DATE>
  45. <TITLE>Performance at first glance</TITLE>
  46. <BODY><![CDATA[
  47. Do not hurry John Doe, it is not arrived the time to scale yet.. However, there are some tuning practices we can always use with ease:
  48. - Take advantage of type hints since PHP ver 7.
  49. - Set variable types with settype.
  50. - Pass and "consume" arrays by reference.
  51. - Use constants.
  52. - Prefer explicit to implicit type conversions.
  53. ]]></BODY>
  54. <SEE/>
  55. <SEEURL/>
  56. <TYPE>tip</TYPE>
  57. <CAT>tuning</CAT>
  58. <INDEX>2</INDEX>
  59. </ITEM>
  60. <ITEM>
  61. <ID>18</ID>
  62. <DATE>Fri October 22th 2021</DATE>
  63. <TITLE>PHP with a performant FPM</TITLE>
  64. <BODY><![CDATA[
  65. The old but safest solution to run PHP by the Apache SAPI mod_php module seems to have been abandoned by the most. In fact, PHP now comes supplied in its package (on installations with —enable-fpm) with PHP-FPM, an high configurable and high performant FastCGI Process Manager. PHP-FPM has different settings but mainly can be configured to run in static (fastest response, but resources consuming), dynamic (fast response, process friendly) or on demand mode (slower response, resource friendly). Have a look to the following link for all tunable settings:
  66. ]]></BODY>
  67. <SEE>An Introduction to PHP-FPM Tuning</SEE>
  68. <SEEURL>https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning</SEEURL>
  69. <TYPE>tip</TYPE>
  70. <CAT>tuning</CAT>
  71. <INDEX>3</INDEX>
  72. </ITEM>
  73. <ITEM>
  74. <ID>19</ID>
  75. <DATE>Fri October 22th 2021</DATE>
  76. <TITLE>PHP with a performant Apache</TITLE>
  77. <BODY><![CDATA[
  78. The Event Multi-Processing Module (MPM) of Apache allows us to tune the behavior of httpd responding simultaneously to more requests by the listeners threads, and set how to free up threads to serve new requests. Please note that in the recent Apache installations the tuned “mpm_event_module” doesn’t figure as a physical file but as a *static* module. Have a look to the following link for all possible settings:
  79. ]]></BODY>
  80. <SEE>Apache2 and php fpm performance optimization</SEE>
  81. <SEEURL>https://medium.com/@sbuckpesch/apache2-and-php-fpm-performance-optimization-step-by-step-guide-1bfecf161534</SEEURL>
  82. <TYPE>tip</TYPE>
  83. <CAT>tuning</CAT>
  84. <INDEX>4</INDEX>
  85. </ITEM>
  86. <ITEM>
  87. <ID>20</ID>
  88. <DATE>Fri October 22th 2021</DATE>
  89. <TITLE>PHP with a performant Nginx</TITLE>
  90. <BODY><![CDATA[
  91. Nginx is a light and high performant web server that can be used as reversed proxy (as frontend server to serve static content only) and is usually coupled with PHP-FPM. There is a lot of good documentation around how to tune performance of Nginx. However here're two directives to cut on server response time almost instantaniously:
  92. # Use Thread Pools (http scope)
  93. aio threads;
  94. # Reuseport Socket Option (server scope)
  95. listen 80 reuseport;
  96. ]]></BODY>
  97. <SEE>Nginx Performance Tuning – Tips and Tricks</SEE>
  98. <SEEURL>https://www.nginx.com/blog/performance-tuning-tips-tricks/</SEEURL>
  99. <TYPE>tip</TYPE>
  100. <CAT>tuning</CAT>
  101. <INDEX>5</INDEX>
  102. </ITEM>
  103. </CONTENT>