Archive for February, 2012

SBDavid

PHP Error Handling and Logging

PHP Error Handling and Logging

Display_startup_errors

Even when display_errors is on, errors that occur during PHP’s startup sequence are not displayed. It’s strongly recommended to keep display_startup_errors off, except for debugging.

These are functions dealing with error handling and logging. They allow you to define your own error handling rules, as well as modify the way the errors can be logged. This allows you to change and enhance error reporting to suit your needs.

With the logging functions, you can send messages directly to other machines, to an email (or email to pager gateway!), to system logs, etc., so you can selectively log and monitor the most important parts of your applications and websites.

The error reporting functions allow you to customize what level and kind of error feedback is given, ranging from simple notices to customized functions returned during errors.

SBDavid

ChkServd TCP check failure threshold

ChkServd TCP check failure threshold

Main >> Server Configuration >> Tweak Settings

The number of times a ChkServd TCP check must fail before notification is sent and the service is restarted. On heavily loaded systems these types of service checks fail occasionally, producing erroneous indications that services are down.

A value of 3 or higher is recommended for most systems.

Linux performance tuning -vm.swappiness

Linux kernel has improved memory subsystem, with which administrators now have a simple interface to fine-tune the swapping behavior of the kernel.  The linux kernel tunable parameter vm.swappiness (/proc/sys/vm/swappiness) can be used to define how aggressively memory pages are swapped to disk.

Linux moves memory pages that have not been accessed for some time to the swap space even if there is enough free memory available. By changing the percentage in /proc/sys/vm/swappiness you can control the swapping behavior, depending on the system configuration.

A high swappiness value means that the kernel will be more apt to unmap mapped pages. A low swappiness value means the opposite, the kernel will be less apt to unmap mapped pages. In other words, the higher the vm.swappiness value, the more the system will swap.

SBDavid

Using CLI Commands LVM

Using CLI Commands LVM

When sizes are required in a command line argument, units can always be specified explicitly. If you do not specify a unit, then a default is assumed, usually KB or MB. LVM CLI commands do not accept fractions.

When specifying units in a command line argument, LVM is case-insensitive; specifying M or m is equivalent, for example, and powers of 2 (multiples of 1024) are used. However, when specifying the –units argument in a command, lower-case indicates that units are in multiples of 1024 while upper-case indicates that units are in multiples of 1000.

All LVM commands accept a -v argument, which can be entered multiple times to increase the output verbosity. For example, the following examples shows the default output of the lvcreate command.

lvcreate -L 50MB new_vg

lvcreate command with the -v argument.

lvcreate -v -L 50MB new_vg

Growing a File System on a Logical Volume

To grow a file system on a logical volume, perform the following steps:

1. Make a new physical volume.
2. Extend the volume group that contains the logical volume with the file system you are growing to include the new physical volume.
3. Extend the logical volume to include the new physical volume.
4. Grow the file system.

*If you have sufficient unallocated space in the volume group, you can use that space to extend the logical volume instead of performing steps 1 and 2.

« Prev - Next »