<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title type="text" xml:lang="en">Guillermo Garron Linux posts</title>
    <link type="application/atom+xml" href="http://garron.me/linux/atom.xml" rel="self"/>
    <link type="text" href="http://garron.me" rel="alternate"/>
    <updated>2012-05-17T09:25:05-04:00</updated>
    <id>http://garron.me</id>
    <author>
        <name>Guillermo Garron</name>
    </author>
    <rights>Copyright (c) 2010-2011 Guillermo Garron</rights>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    <entry>
        <title>Wordpress Performance Comparison: Using Nginx, Apache, APC and Varnish in Different Scenarios</title>
        <link href="http://garron.me/linux/apache-vs-nginx-php-fpm-varnish-apc-wordpress-performance.html"/>
        <updated>2012-04-27T18:17:39-04:00</updated>
        <id>http://garron.me/linux/apache-vs-nginx-php-fpm-varnish-apc-wordpress-performance.html</id>
        <summary type="html">&lt;h3 id='introduction'&gt;Introduction&lt;/h3&gt;

&lt;p&gt;If you follow this blog, you may already know that I&amp;#8217;m somehow obsessed with performance. But performance with low resources.&lt;/p&gt;

&lt;p&gt;I like to try to squeeze every drop of power from a server before upgrading it. Usually this is achievable tweaking configuration of the server.&lt;/p&gt;

&lt;p&gt;This time, I&amp;#8217;ve been playing with &lt;a href='http://www.wordpress.org'&gt;Wordpress&lt;/a&gt; and a Small VPS server. Here the specs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;512 MB RAM&lt;/li&gt;

&lt;li&gt;Shared CPU&lt;/li&gt;

&lt;li&gt;Shared Disk&lt;/li&gt;

&lt;li&gt;Arch Linux 32 Bits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is the smallest &lt;a href='http://www.linode.com/'&gt;Linode&lt;/a&gt; available by the time of this writing.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve tested Wordpress on different possible configurations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apache, PHP, MySQL Standard&lt;/li&gt;

&lt;li&gt;Apache, PHP, MySQL and APC&lt;/li&gt;

&lt;li&gt;Nginx, PHP-FPM, MySQL&lt;/li&gt;

&lt;li&gt;Nginx, PHP-FPM, MySQL and APC&lt;/li&gt;

&lt;li&gt;Nginx, PHP-FPM, MySQL, APC and Varnish&lt;/li&gt;

&lt;li&gt;Apache, PHP, MySQL, APC and Varnish&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I&amp;#8217;ve used the standard Wordpress installation, with no extra plugins installed, not even Total Cache or Super Cache. I think that if you have Varnish Cache running on the server, there is no need for another Cache. Varnish uses RAM so it is more efficient than any Wordpress plugin. RAM is small in this server, if you need more space you can configure Varnish to also use disk as cache and then you have less used files on disk, and most accessed files on RAM.&lt;/p&gt;

&lt;p&gt;Full configurations facts can be found at: &lt;a href='/linux/nginx-php-fpm-mysql-apc-varnish-wordpress-cache-performance.html'&gt;Increase Wordpress performance&lt;/a&gt;&lt;/p&gt;

&lt;h3 id='the_tests'&gt;The tests&lt;/h3&gt;

&lt;p&gt;I&amp;#8217;ve used &lt;a href='http://blitz.io'&gt;blitz.io&lt;/a&gt; to measure the performance of each configuration.&lt;/p&gt;

&lt;p&gt;With Apache as well as with Nginx when APC was not installed, I used 1 to 40 concurrent sessions in one minute. Anything else put the VPS on its knees.&lt;/p&gt;

&lt;p&gt;With the aid of APC, both Apache and Nginx could handle twice as load, so 1 to 80 concurrent sessions in one minute.&lt;/p&gt;

&lt;p&gt;Finally Varnish made the site really fly, and supported 1 to 250 concurrent sessions in one minute, for a potential of &lt;strong&gt;9 Million hits per day&lt;/strong&gt;&lt;/p&gt;

&lt;h3 id='the_results'&gt;The results&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Apache + PHP, no APC or any other aid or cache.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Dotted line = Response times Line = Users&lt;/p&gt;
&lt;img alt='blitz.io result, wordpress on Apache' class='image' src='/images/2012-04/1-40-60-apache-php.png' /&gt;
&lt;p&gt;You can download the PDF of the report &lt;a href='/uploaded-files/2012-04/1-40_60-apache-php.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nginx + PHP-FPM, no APC or any other aid or cache&lt;/strong&gt;&lt;/p&gt;
&lt;img alt='blitz.io result, wordpress on Nginx' class='image' src='/images/2012-04/1-40-60-nginx-php-fpm.png' /&gt;
&lt;p&gt;You can download the PDF of the report &lt;a href='/uploaded-files/2012-04/1-40_60-nginx-php-fpm.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apache + PHP + APC&lt;/strong&gt;&lt;/p&gt;
&lt;img alt='blitz.io result, wordpress, apache, php with APC' class='image' src='/images/2012-04/apache-apc.png' /&gt;
&lt;p&gt;You can download the PDF of the report &lt;a href='/uploaded-files/2012-04/1-80_60-apache-php-apc.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nginx + PHP-FPM + APC&lt;/strong&gt;&lt;/p&gt;
&lt;img alt='blitz.io result, wordpress, Nginx, php-fpm and APC' class='image' src='/images/2012-04/nginx-php-fpm-apc-80.png' /&gt;
&lt;p&gt;You can download the PDF of the report &lt;a href='/uploaded-files/2012-04/1-80-60-varnish-nginx-php-fpm-apc.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nginx + PHP-FPM + APC + Varnish&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally when Varnish is installed it really makes a difference, and you can go from 3+ million visits per day to 9 million visits per day.&lt;/p&gt;
&lt;img alt='blitz.io result, wordpress, Nginx, php-fpm, APC and Varnish, 9 million visits per day' class='image' src='/images/2012-04/1-250-60-nginx-varnish.png' /&gt;
&lt;p&gt;You can download the PDF report &lt;a href='/uploaded-files/2012-04/1-250-60-nginx-varnish.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edit: Because one reader asked, here are the results of:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apache + PHP with APC and Varnish.&lt;/strong&gt;&lt;/p&gt;
&lt;img alt='apache, php, apc, varnish, wordpress' class='image' src='/images/2012-04/apache-php-varnish-apc.png' /&gt;
&lt;p&gt;You can download the PDF report &lt;a href='/uploaded-files/2012-04/apache-php-apc-varnish.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3 id='conclusion'&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;As you can see, with a kind-of-well-configured server, you can use a standard copy of Wordpress with no Total Cache or Super Cache plugins, so keeping a very clean and standard Wordpress configuration.&lt;/p&gt;</summary>
    </entry>
    
    
    
    <entry>
        <title>Nginx, PHP-FPM, APC, Varnish and Wordpress</title>
        <link href="http://garron.me/linux/nginx-php-fpm-mysql-apc-varnish-wordpress-cache-performance.html"/>
        <updated>2012-04-27T17:20:00-04:00</updated>
        <id>http://garron.me/linux/nginx-php-fpm-mysql-apc-varnish-wordpress-cache-performance.html</id>
        <summary type="html">&lt;h3 id='installing_needed_software'&gt;Installing needed software&lt;/h3&gt;

&lt;p&gt;I&amp;#8217;m using Arch Linux as the server, so let&amp;#8217;s install needed software. First be sure you have the latest available software now install all the stuff.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pacman -Syu&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now install &lt;em&gt;Nginx&lt;/em&gt;, &lt;em&gt;PHP-FPM&lt;/em&gt; and &lt;em&gt;MySQL&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pacman -S nginx php-fpm mysql&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now let&amp;#8217;s first take some steps to be sure mysql installation is secure.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/etc/rc.d/mysqld start
mysql_secure_installation&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In case you need help answering the questions, you can find some help in &lt;a href='http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-on-centos-6.0'&gt;this page&lt;/a&gt; check the &lt;em&gt;MySQL&lt;/em&gt; section.&lt;/p&gt;

&lt;h3 id='configure_phpfpm'&gt;Configure PHP-FPM&lt;/h3&gt;

&lt;p&gt;First let&amp;#8217;s be sure &lt;em&gt;PHP-FPM&lt;/em&gt; is using a socks instead of listening to a port, that makes it more efficient. In my Arch Linux version, that is already that way. Anyway look for these lines.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;;listen = 127.0.0.1:9000
listen = /var/run/php-fpm/php-fpm.sock&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And be sure that the one listening to a port is commented and not the one listening to a socket, if you need to add the line do it.&lt;/p&gt;

&lt;p&gt;You also need to uncomment these lines from &lt;code&gt;php.ini&lt;/code&gt; file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;;extension=mysqli.so
;extension=mysql.so&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And make them look like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;extension=mysqli.so
extension=mysql.so&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This way PHP will be able to connect with MySQL, which is needed by Wordpress&lt;/p&gt;

&lt;h3 id='configure_nginx'&gt;Configure Nginx&lt;/h3&gt;

&lt;p&gt;Now that we have &lt;em&gt;PHP-FPM&lt;/em&gt; working and listing to a socket, let&amp;#8217;s make Nginx send PHP requests to that socket.&lt;/p&gt;

&lt;p&gt;Add this to your server snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
    }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We should now have a server capable to manage PHP scripts.&lt;/p&gt;

&lt;h3 id='configure_mysql'&gt;Configure MySQL&lt;/h3&gt;

&lt;p&gt;It is &lt;em&gt;MySQL&lt;/em&gt; turn now, let&amp;#8217;s create the database:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mysql -u root -p&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now create the database, and grant access to the user.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;CREATE DATABASE `wordpress`;
GRANT ALL PRIVILEGES ON `wordpress`.* TO &amp;#39;wordpress&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED BY &amp;#39;your-password&amp;#39;;
FLUSH PRIVILEGES;
EXIT&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Enable MySQL Query Cache&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add this to the &lt;code&gt;my.cnf&lt;/code&gt; file in the &lt;code&gt;[mysqld]&lt;/code&gt; section:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;query_cache_limit = 1M
query_cache_size = 16M
query_cache_type = 1&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will make MySQL a little bit more efficient, as it will be able to cache some queries.&lt;/p&gt;

&lt;h3 id='install_and_enable_apc'&gt;Install and enable APC&lt;/h3&gt;

&lt;p&gt;In my case with Arch Linux I did:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pacman -S php-apc&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And to enable it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit &lt;code&gt;php.ini&lt;/code&gt; file&lt;/li&gt;

&lt;li&gt;Add this line: &lt;code&gt;extension=apc.so&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;APC is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Alternative PHP Cache is a free, open source (PHP license) framework that optimizes PHP intermediate code and caches data and compiled code from the PHP bytecode compiler in shared memory. (Source: Wikipedia)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id='install_varnish'&gt;Install Varnish&lt;/h3&gt;

&lt;p&gt;APC will increase performance with logged users, but for not logged users, the best way to increase performance is by using &lt;a href='https://www.varnish-cache.org/'&gt;Varnish Cache&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Varnish Cache&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;pacman -S varnish&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Configure Varnish Cache for Wordpress&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve used this &lt;a href='https://github.com/mattiasgeniar/varnish-3.0-configuration-templates/blob/master/conf.d/_wordpress-receive.vcl'&gt;example&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id='install_wordpress'&gt;Install Wordpress&lt;/h3&gt;

&lt;p&gt;You are now ready to go to &lt;a href='http://www.wordpress.org'&gt;wordpress&lt;/a&gt; site and download the latest version, and install it.&lt;/p&gt;

&lt;h3 id='full_configuration_files'&gt;Full Configuration Files&lt;/h3&gt;

&lt;p&gt;If you want to get the full configuration files, download them &lt;a href='/uploaded-files/conf-files.tar.gz'&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is a description of what you will find:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/etc/nginx/conf/nginx.conf&lt;/li&gt;

&lt;li&gt;/etc/php/php.ini&lt;/li&gt;

&lt;li&gt;/etc/php/php-fpm&lt;/li&gt;

&lt;li&gt;/etc/conf.d/varnish&lt;/li&gt;

&lt;li&gt;/etch/varnish/default.vcl&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id='comparing_nginx_and_apache'&gt;Comparing Nginx and Apache&lt;/h3&gt;

&lt;p&gt;You can see some differences between &lt;a href='/linux/apache-vs-nginx-php-fpm-varnish-apc-wordpress-performance.html'&gt;Apache and Nginx while running Wordpress, with and without APC and Varnish&lt;/a&gt;&lt;/p&gt;</summary>
    </entry>
    
    
    
    
    
    <entry>
        <title>scp command line to securely copy files over ssh, between Linux, Mac or Windows</title>
        <link href="http://garron.me/linux/scp-linux-mac-command-windows-copy-files-over-ssh.html"/>
        <updated>2012-04-25T16:59:35-04:00</updated>
        <id>http://garron.me/linux/scp-linux-mac-command-windows-copy-files-over-ssh.html</id>
        <summary type="html">&lt;h3 id='scp_introduction'&gt;SCP Introduction&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;scp&lt;/strong&gt; stands for secure cp (copy), which means you can copy files across ssh connection. That connection will be securely encrypted, it is a very secure way to copy files between computers&lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;scp&lt;/code&gt; to copy files from or to a remote server. You can also copy files from one remote server to another remote server, without passing traffic through your PC.&lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;scp&lt;/code&gt; on Linux, Mac and Windows (using &lt;a href='http://winscp.net/eng/index.php'&gt;WinSCP&lt;/a&gt;).&lt;/p&gt;

&lt;h3 id='scp_usage'&gt;SCP Usage&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]&lt;/code&gt;&lt;/pre&gt;
&lt;dl&gt;
&lt;dt&gt;from-host&lt;/dt&gt;
&lt;dd&gt;Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command&lt;/dd&gt;
&lt;dt&gt;user&lt;/dt&gt;
&lt;dd&gt;Is the user which have the right to access the file and directory, that is supposed to be copied in the case of the from-host, and the user who has the rights to write in the to-host&lt;/dd&gt;
&lt;dt&gt;source-file&lt;/dt&gt;
&lt;dd&gt;Is the file or files that are going to be copied to the destination host, it can be a directory but in that case you need to specify the &lt;em&gt;-r&lt;/em&gt; option to copy the contents of the directory&lt;/dd&gt;
&lt;dt&gt;destination-file&lt;/dt&gt;
&lt;dd&gt;Is the name that the copied file is going to take in the to-host, if none is given all copied files are going to keep its names&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id='scp_options'&gt;SCP Options&lt;/h3&gt;
&lt;dl&gt;
&lt;dt&gt;-p&lt;/dt&gt;
&lt;dd&gt;Preserves the modification and access times, as well as the permissions of the source-file in the destination-file&lt;/dd&gt;
&lt;dt&gt;-q&lt;/dt&gt;
&lt;dd&gt;Do not display the progress bar&lt;/dd&gt;
&lt;dt&gt;-r&lt;/dt&gt;
&lt;dd&gt;Recursive, so it copies the contents of the source-file (directory in this case) recursively&lt;/dd&gt;
&lt;dt&gt;-v&lt;/dt&gt;
&lt;dd&gt;Displays debugging messages&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id='scp_examples'&gt;SCP Examples&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;scp *.txt user@remote.server.com:/home/user/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That is going to copy all files with &lt;em&gt;.txt&lt;/em&gt; extension to the folder /home/user in the remote.server.com host&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That is going to recursively copy all files from Miguel&amp;#8217;s home directory on 10.1.2.2 to his home folder in 10.1.2.3 host.&lt;/p&gt;

&lt;p&gt;As have been told before, &lt;code&gt;scp&lt;/code&gt; copies files between computers using ssh, and there are three types of usage:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copy files from a local computer to a remote computer&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp somefile username@server:/home/username/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Copy files from a remote server to your local computer&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp username@server:/home/username/file_name /home/local-username/file-name&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Copy files from a remote server to another remote computer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is really interesting and very useful, as the files copied from one server to the other, are not going to pass through your computer. The traffic is going to pass from one server to the other directly.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp user_name1@server1:/home/user_name1/file_name user_name2@server2:/home/user_name2/&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id='scp_tricks'&gt;SCP Tricks&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Bandwidth limit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You may limit the bandwidth used by &lt;code&gt;scp&lt;/code&gt; command&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp -l limit username@server:/home/uername/* .&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where limit is specified in Kbit/s.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Increase scp speed&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;scp&lt;/code&gt; uses AES-128 to encrypt data, this is very secure, but also a litle bit slow. If you need more speed and still have security, you can use Blowfish or RC4.&lt;/p&gt;

&lt;p&gt;To increase &lt;code&gt;scp&lt;/code&gt; speed change chipher from the default AES-128 to Blowfish&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp -c blowfish user@server:/home/user/file .&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or use RC4 which seems to be the fastest&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp -c arcfour user@server:/home/user/file .&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This last one is not very secure, and it may not be used if security is really an issue for you. You can also increase security while decreasing speed. Everything has its cost.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scp -c 3des user@server:/home/user/file .&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That is maybe the slowest, but also maybe the more secure one (I may be wrong, I&amp;#8217;m not an expert in encryption).&lt;/p&gt;

&lt;h3 id='final_notes'&gt;Final notes&lt;/h3&gt;

&lt;p&gt;It is very important to consider that &lt;code&gt;scp&lt;/code&gt; encrypts the data before sending it over the internet. So, if you can use it over ftp or rcp, you better use it.&lt;/p&gt;

&lt;p&gt;Finally, as I said before, you can use &lt;a href='http://winscp.net/eng/index.php'&gt;WinSCP&lt;/a&gt; to copy to and from Windows to Linux or Mac. For the Mac OS X &lt;code&gt;scp&lt;/code&gt; is supported by default, just like with Linux.&lt;/p&gt;</summary>
    </entry>
    
    
    
    
    
    <entry>
        <title>How to: Purge, Flush or Delete Postfix Queue, or a Single Email</title>
        <link href="http://garron.me/linux/delete-purge-flush-mail-queue-postfix.html"/>
        <updated>2012-04-25T14:53:30-04:00</updated>
        <id>http://garron.me/linux/delete-purge-flush-mail-queue-postfix.html</id>
        <summary type="html">&lt;p&gt;To flush or purge the postfix mail queue, just enter this command&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;postfix -f&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But if you need to delete an individual email from the queue, you&amp;#8217;ll first need to see the queue. Traditionally you use &lt;code&gt;mailq&lt;/code&gt; this time we&amp;#8217;ll use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;postqueue -p&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the output should show all messages in queue:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;5642B4D8647* 1683500 Tue Jun  3 08:37:27  xxxxxx@xxxxxxx.com
                                         rrrrrrrrr@hotmail.com

9359B4D82B1* 1635730 Tue Jun  3 08:36:53  xxxxxx@xxxxxxx.com
                                         yyyyyyyy@hotmail.com&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first number is the message ID, if you only want to delete one of them, enter:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;postsuper -d 5642B4D8647&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will only delete one email for the queue, that specific email you want to delete from it.&lt;/p&gt;

&lt;p&gt;If you want to delete all deferred mails, you can use:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;postsuper -d deferred&lt;/code&gt;&lt;/pre&gt;</summary>
    </entry>
    
    
    
    
    
    
    
    
    
    
</feed>

