com presentations: More work on Confoo talks: confoo16a.html confoo16a.xml slides/intro/mysqli.png slides/intro/mysqlnd.png slides/intro/pdo.png slides/intro/php7_tuning.xml

[email protected] (Rasmus Lerdorf) Tue, 23 Feb 2016 06:47:57 +0000
Newsgroups php.pres
Message-ID <[email protected]>
Commit:    eb02969c5a6b672df577022c57666576b2550561
Author:    Rasmus Lerdorf <[email protected]>         Mon, 22 Feb 2016 22:47:57 -0800
Parents:   d0d97d5031f99d093b3f5f109ed4fa380383a7c8
Branches:  master

Link:       http://git.php.net/?p=presentations.git;a=commitdiff;h=eb02969c5a6b672df577022c57666576b2550561

Log:
More work on Confoo talks

Changed paths:
  M  confoo16a.html
  M  confoo16a.xml
  A  slides/intro/mysqli.png
  A  slides/intro/mysqlnd.png
  A  slides/intro/pdo.png
  A  slides/intro/php7_tuning.xml


Diff:
diff --git a/confoo16a.html b/confoo16a.html
index 5ae2564..8d72292 100644
--- a/confoo16a.html
+++ b/confoo16a.html
@@ -550,6 +550,61 @@ pushbot: clear
 		<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 -&gt; /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>
 		<ul>
diff --git a/confoo16a.xml b/confoo16a.xml
index 4d26ed5..07f44ee 100644
--- a/confoo16a.xml
+++ b/confoo16a.xml
@@ -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>
diff --git a/slides/intro/mysqli.png b/slides/intro/mysqli.png
new file mode 100644
index 0000000..32f7c83
Binary files /dev/null and b/slides/intro/mysqli.png differ
diff --git a/slides/intro/mysqlnd.png b/slides/intro/mysqlnd.png
new file mode 100644
index 0000000..c674b7c
Binary files /dev/null and b/slides/intro/mysqlnd.png differ
diff --git a/slides/intro/pdo.png b/slides/intro/pdo.png
new file mode 100644
index 0000000..d8b572f
Binary files /dev/null and b/slides/intro/pdo.png differ
diff --git a/slides/intro/php7_tuning.xml b/slides/intro/php7_tuning.xml
new file mode 100644
index 0000000..63d4cc9
--- /dev/null
+++ b/slides/intro/php7_tuning.xml
@@ -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>