mirror of
https://github.com/php/presentations.git
synced 2026-03-23 23:22:22 +01:00
More work on Confoo talks
This commit is contained in:
@@ -549,6 +549,61 @@ pushbot: clear
|
||||
<section id="prod_mem">
|
||||
<img src="/presentations/slides/intro/mem.png" align="center" width="882" height="465">
|
||||
</section> </section>
|
||||
<section>
|
||||
<section id="php7_tune_opcache">
|
||||
<h2 margin-bottom="2em">PHP 7 Tuning</h2><br>
|
||||
<p class="p" style="font-size:2em;">Opcache</p>
|
||||
<pre><code class="ini" data-trim style="font-size:1.1em;">opcache.memory_consumption=2048
|
||||
opcache.max_accelerated_files=100000
|
||||
opcache.validate_timestamps=1
|
||||
opcache.revalidate_freq=2
|
||||
opcache.save_comments=0
|
||||
opcache.enable_file_override=0
|
||||
opcache.enable_cli=0
|
||||
opcache.max_wasted_percentage=10
|
||||
opcache.interned_strings_buffer=128
|
||||
opcache.fast_shutdown=1
|
||||
opcache.huge_code_pages=1
|
||||
opcache.optimization_level=0x7FFFBFFF</code></pre>
|
||||
</section>
|
||||
<section id="php7_tune_huge">
|
||||
<p class="p" style="font-size:2em;">Huge Pages</p>
|
||||
<pre><code class="shell nohighlight" data-trim style="font-size:1.2em;">$ sysctl -w vm.nr_hugepages=512
|
||||
vm.nr_hugepages = 512
|
||||
(Add it to your /etc/sysctl.conf)
|
||||
|
||||
$ grep Huge /proc/meminfo
|
||||
AnonHugePages: 6144 kB
|
||||
HugePages_Total: 512
|
||||
HugePages_Free: 300
|
||||
HugePages_Rsvd: 0
|
||||
HugePages_Surp: 0
|
||||
Hugepagesize: 2048 kB</code></pre>
|
||||
</section>
|
||||
<section id="php7_tune_realpath">
|
||||
<p class="p" style="font-size:2em;">increase realpath_cache_size</p>
|
||||
<pre><code class="ini" data-trim style="font-size:2em;">realpath_cache_size=128k</code></pre>
|
||||
</section>
|
||||
<section id="php7_tune_mysql">
|
||||
<p class="p" style="font-size:2em;">If using MySQL, use mysqlnd</p>
|
||||
<img src="/presentations/slides/intro/mysqli.png" align="center" width="958" height="167">
|
||||
<img src="/presentations/slides/intro/pdo.png" align="center" width="952" height="95">
|
||||
<p class="p" style="font-size:1em;">Check your command buffer usage</p>
|
||||
<img src="/presentations/slides/intro/mysqlnd.png" align="center" width="947" height="140">
|
||||
</section>
|
||||
<section id="php7_tune_tmpfs">
|
||||
<p class="p" style="font-size:2em;">DocumentRoot on tmpfs</p>
|
||||
<pre><code class="shell nohighlight" data-trim style="font-size:1em;">$ mount | grep tmpfs
|
||||
tmpfs on /var/www type tmpfs (rw,relatime,size=12288000k,mode=755)
|
||||
|
||||
$ ls -la /var/www
|
||||
total 5
|
||||
drwxr-xr-x 5 root root 160 Feb 23 02:47 .
|
||||
drwxr-xr-x 26 root root 4096 Feb 7 19:40 ..
|
||||
lrwxrwxrwx 1 root root 14 Feb 23 02:47 current -> /var/www/A
|
||||
drwxrwxr-x 25 apache apache 640 Feb 11 22:04 A
|
||||
drwxrwxr-x 25 apache apache 640 Feb 11 22:04 B</code></pre>
|
||||
</section> </section>
|
||||
<section>
|
||||
<section id="numa">
|
||||
<h2 margin-bottom="2em">Hyperthreading and NUMA</h2><br>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<slide>slides/intro/etsy_deploy.xml</slide>
|
||||
|
||||
<slide>slides/intro/php7prod.xml</slide>
|
||||
<slide>slides/intro/php7_tuning.xml</slide>
|
||||
<slide>slides/intro/numa.xml</slide>
|
||||
|
||||
<slide>slides/intro/driveshaft.xml</slide>
|
||||
|
||||
BIN
slides/intro/mysqli.png
Normal file
BIN
slides/intro/mysqli.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
slides/intro/mysqlnd.png
Normal file
BIN
slides/intro/mysqlnd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
slides/intro/pdo.png
Normal file
BIN
slides/intro/pdo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
66
slides/intro/php7_tuning.xml
Normal file
66
slides/intro/php7_tuning.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<slide title="PHP 7 Tuning" section="php7_tune_opcache">
|
||||
|
||||
<blurb fontsize="2em">Opcache</blurb>
|
||||
|
||||
<example fontsize="1.1em" marginleft="7em" result='0' title="" type="ini"><![CDATA[<?php
|
||||
opcache.memory_consumption=2048
|
||||
opcache.max_accelerated_files=100000
|
||||
opcache.validate_timestamps=1
|
||||
opcache.revalidate_freq=2
|
||||
opcache.save_comments=0
|
||||
opcache.enable_file_override=0
|
||||
opcache.enable_cli=0
|
||||
opcache.max_wasted_percentage=10
|
||||
opcache.interned_strings_buffer=128
|
||||
opcache.fast_shutdown=1
|
||||
opcache.huge_code_pages=1
|
||||
opcache.optimization_level=0x7FFFBFFF
|
||||
]]></example>
|
||||
|
||||
<break lines="1" section="php7_tune_huge"/>
|
||||
|
||||
<blurb fontsize="2em">Huge Pages</blurb>
|
||||
|
||||
<example fontsize="1.2em" marginleft="7em" result='0' title="" type="shell nohighlight"><![CDATA[<?php
|
||||
$ sysctl -w vm.nr_hugepages=512
|
||||
vm.nr_hugepages = 512
|
||||
(Add it to your /etc/sysctl.conf)
|
||||
|
||||
$ grep Huge /proc/meminfo
|
||||
AnonHugePages: 6144 kB
|
||||
HugePages_Total: 512
|
||||
HugePages_Free: 300
|
||||
HugePages_Rsvd: 0
|
||||
HugePages_Surp: 0
|
||||
Hugepagesize: 2048 kB
|
||||
]]></example>
|
||||
|
||||
<break lines="1" section="php7_tune_realpath"/>
|
||||
<blurb fontsize="2em">increase realpath_cache_size</blurb>
|
||||
<example fontsize="2em" marginleft="7em" result='0' title="" type="ini"><![CDATA[<?php
|
||||
realpath_cache_size=128k
|
||||
]]></example>
|
||||
|
||||
<break lines="1" section="php7_tune_mysql"/>
|
||||
<blurb fontsize="2em">If using MySQL, use mysqlnd</blurb>
|
||||
<image width="958" height="167" filename="mysqli.png" align="center"/>
|
||||
<image width="952" height="95" filename="pdo.png" align="center"/>
|
||||
<blurb fontsize="1em">Check your command buffer usage</blurb>
|
||||
<image width="947" height="140" filename="mysqlnd.png" align="center"/>
|
||||
|
||||
<break lines="1" section="php7_tune_tmpfs"/>
|
||||
<blurb fontsize="2em">DocumentRoot on tmpfs</blurb>
|
||||
<example fontsize="1em" marginleft="7em" result='0' title="" type="shell nohighlight"><![CDATA[<?php
|
||||
$ mount | grep tmpfs
|
||||
tmpfs on /var/www type tmpfs (rw,relatime,size=12288000k,mode=755)
|
||||
|
||||
$ ls -la /var/www
|
||||
total 5
|
||||
drwxr-xr-x 5 root root 160 Feb 23 02:47 .
|
||||
drwxr-xr-x 26 root root 4096 Feb 7 19:40 ..
|
||||
lrwxrwxrwx 1 root root 14 Feb 23 02:47 current -> /var/www/A
|
||||
drwxrwxr-x 25 apache apache 640 Feb 11 22:04 A
|
||||
drwxrwxr-x 25 apache apache 640 Feb 11 22:04 B
|
||||
]]></example>
|
||||
|
||||
</slide>
|
||||
Reference in New Issue
Block a user