Category: Linux

Slow DNS Lookups For Web Requests

Ran into a strange problem recently … web server behind a firewall was able to resolve names with “dig” sucessfully but attempts to fetch web pages with “wget” or “curl” was very slow … seemed to hang on name resolution.  So this would work fine:

but this would hang for several seconds:

This problem extended to curl requests from with in PHP … in this case a Magento website … various plugins in the site were “calling home” when loading admin pages which resulted in making the admin painfully slow. After much debugging we concluded that the problem was due to the fact that certain versions of glibc run IPv4 and IPv6 requests in parallel which breaks some firewalls and/or DNS servers. The work around was to add this option in /etc/resolv.conf:

This forces the requests to be made sequentially instead of in parallel. Hope this helps other

Read More »

PayPal Certificate Upgrade

PayPal is upgrading the certificate for www.paypal.com to SHA-256. This endpoint is also used by merchants using the Instant Payment Notification (IPN) product. A detailed FAQ has been provided here: Merchant Security System Upgrade Guide Also the microsite: 2015-2016 SSL Certificate Change For most online store owners the primary concern is that your server has the correct new G5 certificate installed. Instructions for testing can be found here: Cert Check For Linux If you’re running CentOS or RedHat then the command is:

   

Read More »

MariaDB on CentOS 7 – “Error in accept: Too many open files”

By default is seems the soft and hard open files limits on MariaDB in CentOS 7 are 1024 and 4096 respectfully. You can see these limits by first getting the process ID:

And then looking at the limits in the proc filesystem:

You’ll see something like this:

Notice the numbers for “Max open files”. If you run into problems with MariaDB failing and you see errors like this in the log:

Then you need to increase the open files limits by editing:

and adding this line:

to the “[Service]” section. Then reload the systemctl daemon:

and restart the MariaDB service:

Now the limit will be increased.  For example:

UPDATE: We’ve seen similar problems with nginx. The solution is similar … increase the limits for the nginx service. UPDATE: As noted by Bastiaan Welmers in the comments, it better to copy the service control file

Read More »

XFS Requires “inode64” On Large Filesystems

Recently ran into a problem with a large distributed GlusterFS filesystem. All of a sudden we started getting errors about no free space on device when trying to write files. The individual bricks on the distributed GlusterFS filesystem were hosted on XFS formatted partitions. After some investigation we found that when the size of the brick’s XFS filesystem exceeded 16TB the “no free space” errors started. The solution was to add “inode64” to the mount options for the XFS partition. The XFS FAQ states the following: By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like “disk full” when you still have plenty space free, but there’s no more place in the first TB to create a new inode. Also, performance

Read More »

How To Clear btmp File

Running low on storage. Check the /etc/btmp file where failed login attempts are logged. This file may be very large:

The file can be cleared like this:

Credit for this goes to Tournas Dimitrios who has a great article on btmp: https://tournasdimitrios1.wordpress.com/2010/12/28/how-to-clear-and-delete-last-logged-in-users-and-bad-login-attemps-log-wtmp-and-btmp/

Read More »

Categories

Get a free consultation from Reliable Penguin

Submit the form—or for immediate service call 866-649-7984.