Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

SPANStor /var sizing recommendations for Compact Flash systems

SPANStor systems that boot from Compact Flash use a 128MB RAM disk in memory
after installation for the /var partition. System files necessary for the proper operation of
SPANStor are maintained in the /var partition which is created in the “a” slice (for
example /var on sd0 would reside on /sd0a). The /var partition needs to be moved from
memory disk to a partition on hard disk as part of the installation procedure to facilitate
proper long term operation and reduce the number of writes to the Compact Flash. A
utility program can be accessed from the SPANStor Administrative GUI under System
Configuration / Expert Mode / Compact Flash Setup to configure the /var partition on a
disk device.

The Compact Flash Setup Dialog is shown below:

The current location for the /var partition is


displayed, along with the size of /var and
the space utilized.

Select the Disk Drive Configuration dialog


to move the system files in /var from
memory to a disk drive partition

The /var partition contains files that are updated frequently like the log files in the
/var/log directory, configuration database files, and other operating system files. Critical
files in the /var partition are synchronized using the /varback directory which resides on
the Compact Flash boot partition to insure that these files are updated on Compact Flash.
Synchronization occurs every minute for critical files, every 30 minutes for important
files and once a day at 3:30am for all other files not excluded in /var.
The setup dialog allows the size of /var to be selected from a pulldown selection list
ranging from 256MB to 4068MB (4GB). Since the disk drive may require partitioning if
the 0a partition does not exist or match the requested size, this routine may require a
repartition of the drive selected for /var.

REPARTITIONING WILL CAUSE ANY DATA PRESENT ON THE DRIVE TO


BE DELETED!

Based on the size selected the dialog will


indicate whether a drive will be
repartitioned. Since re-partitioning adjusts
the data “0g” partition in addition to the
“0a” partition any existing data on a
partition will be destroyed.

If a “0a” partition already exists on the


selected drive, the drive will not require
repartitioning, only a system reboot will be
required for this case.

Only unmounted Volumes can be selected


for use as a /var target.

The var_sync.php process runs under control of crontab to manage the synchronization of
files between /var and /varback. Critical files include the configuration database files,
the winbindd_idmap.tdb, and secrets files. Important files include the primary system log
files in /var/log and the database files in /var/db.

The synchronization process exludes the contents of the /var/tmp directory, the backup
index files included in /var/backup, as well as /swap and /run.

The largest potential usage of space in /var comes from the backup index files created to
support incremental backups and restores, as well as the database monitor files. The
system swap file is also created in /var and is the single largest usage of space in /var.
The current swap size can be examined using the #swapctl –l command.

System Swap File Size: ( allow for 1GB if possible)


The swap file is created during installation using 1/2 of the free space in the /var partition
(excluding the /var/swap file itself), with a minimum size of 64 MB and a maximum size
of 1 GB. This can be overridden with the compactflash_swapsize parameter in
/etc/rc.conf if necessary in special situations.

Examples:
/var size = 512MB swapfile size = 256MB
/var size = 1024MB swapfile size = 512MB
/var size = 2048MB swapfile size = 1GB
/var size = 3072MB swapfile size = 1GB

Log File Sizes: ( allow 25 MB for log usage on average)

The space consumed by some log files is highly dependent on the logging level in force.
It is recommended that the smbd log level which is set to a default of 2 to aid in
installation debugging, be reduced to 0 using the Admin GUI CIFS / Expert Mode and
the winbindd log level be reduced from 2 to 0 by editing the /etc/rc.d/nss_winbind script
and changing the command_args="-B -d2" to command_args="-B –d0" to reduce the
logging level.
SPANStor automatically runs the newsyslog routing to check, rename, and archive the
log files in /var every 15 minutes. Any time a log file exceeds 1MB it is renamed and
gzipped to conserve space. Up to 10 archived log files are kept for each system log.

Log file definitions from /etc/newsyslog.conf:


#
# logfilename [user:group] mode ngen size time flags
#
/var/cron/log root:wheel 600 3 1024 * Z
/var/log/aculog uucp:dialer 640 7 * 168 Z
/var/log/authlog 600 5 30 * Z
/var/log/kerberos.log 640 7 * 168 ZN
/var/log/lpd-errs 640 7 10 * Z
/var/log/maillog 644 7 500 * ZP
/var/log/messages 644 10 1024 * ZP
/var/log/wtmp 644 7 * 168 ZBN
/var/log/xferlog 640 7 250 * Z
#
# NSS-managed log files
#
/var/log/nss.log 666 10 1024 * ZP
/var/log/events 666 10 1024 * ZP
/var/log/virus_scans.log 666 10 1024 * ZP
/var/log/log.nmbd 666 10 1024 * ZP
/var/log/log.smbd 666 10 1024 * ZP
/var/log/log.winbindd 666 10 1024 * ZP
/var/log/snmpd.log 666 10 1024 * ZP
/var/log/mysql.log 666 10 1024 * ZP
/var/log/backup 666 10 1024 * ZP
/var/log/restore 666 10 1024 * ZP
/var/log/httpd/access_log 666 10 1024 * ZP
/var/log/httpd/error_log 666 10 1024 * ZP
Database and other File Usage: (allow 50 MB)
The monitor table in the database accounts for 40MB of the 50MB used here.
Monitoring data is kept for up to 180 days and with 180 days of usage information the
size of the monitor database and its associated index is approximately 40MB.

Backup Index and Incremental File Usage:

SPANStor supports a number of backup methods that create index and incremental files
when backups are taken, or update the incremental file and rebuild the index files as
necessary. It is possible and recommended to move the Database Index Files from /var
to some other location using the Admin GUI / Backup / Setup/ Database Location dialog,
which will significantly reduce the amount of space consumed in /var for incremental
backups.

An index file (listing of files and dirs backed up) is created for each backup dataset which
can cause index file usage in /var to grow quite large if many different data sets are
backed up. A data set is a named backup of some specific location. For example, if you
backup the entire system on Saturday as a single operation, this would be considered one
dataset. If you backup ten different users home directories each weekday, this would
create 10 data sets. Each unique data set has an associated index file which is stored in
the /var/backups directory under a sub-directory for the backup type (NDMP, automatic,
manual, etc.) and in a directory structure that corresponds to the data set backed up. In
addition to index files, full backups create an incremental file that is used by incremental
backups to determine what changes have occurred since the last full backup or
incremental backup.

The following table indicates some approximate values for the amount of space
consumed in /var by backup index files. These values are based on the following
assumptions:

Average file size = 100 KB


Average file path = 64 bytes (characters)
Average files per directory = 50
8:1 compression ratio of backup log files
Local backups are a worst-case in terms of usage
If local backups are in use, NDMP typically won't be used concurrently
Both auto-backups and manual backups are used for this example
2 backup sets are retained
"Normal" files in /var (logs, db, etc.) = 75 MB maximum

Assuming this is a starting point, here are some calculated /var sizes (excluding swap):

Data # Files # Dirs Backup Database Swap File Total /var


Storage Index size and other Size* req’d.
1 GB 10,486 210 1 MB 75 MB 512 MB 588 MB
10 GB 104,858 2,097 2 MB 75 MB 512 MB 589 MB
100 GB 1,048,576 20,972 19 MB 75 MB 512 MB 606 MB
250 GB 2,621,440 52,429 46 MB 75 MB 512 MB 633 MB
500 GB 5,242,880 104,858 93 MB 75 MB 1000 MB 1168 MB
1024 GB 10,737,418 214,748 150 MB 75 MB 1000 MB 1225 MB
2048 GB 21,474,836 429,497 380 MB 75 MB 1000 MB 1455 MB
4096 GB 42,949,673 858,993 760 MB 75 MB 1000 MB 1835 MB

*Note that the swap file size varies based on the size of /var. Swap will typically be 512
MB to 1 GB based on the size of /var. It is recommended that /var be 2GB minimum or
3GB wherever possible to insure a 1GB swap file.

Some other examples of calculating backup index file usage in /var:

Formula for detemining approximate /var space used by backup sets:


Where f = number of files on all volumes
Where fbytes = number of bytes in file name
Where dbytes= number of bytes in directory name
Where d = number of directories on all volumes
Where compratio = compression factor (files are gzipped) (normally= 8 to 10)
Where any_native_backups (ie manual backup or restores ever done - non autos)
is either 0 for none or 1 if manual backup present
Where any_auto_backups_defined is 0 for none or 1 if auto backup performed.

var_space_for_backups_in_bytes =
(num_auto_backup_sets*dbytes*d)+((any_auto_backups_defined* f*fbytes) / compratio)
+(num_NDMP_sets*dbytes*d)+((any_native_backups*f*fbytes) / compratio)

Divide by 1048576 to get MB.

Make sure that a 'backup set' is a full backup, as incrementals will use and update the
incremental file from the last full backup. For NDMP, a backup set can be a single
volume, single dir, etc. - so insure the dirs and files counted are from the backup location
(dir, volume etc.). NDMP backups create an incremental file but do not create any index
files, as this information is passed to the NDMP client as file history.

Example case 1:
User uses automatic backups and uses one full backup set - and one incremental set
(which will use the full incremental index file).
f = 10 million files.
fbytes=100
d = 1 million directories.
dbytes = 100
compratio=10

/var space required =


#Auto backupset + Auto Backup defined
(1*100*1,000,000)+((1*10,000,000*100)/10)+(0*100*1,000,000)+((0*10,000,000*100)/10) =
(100,000,000) + (100,000,000) / 1048576 = 190.7MB of /var usage for backup files

NDMP Example case.


User has three NDMP backup sets; one for each volume - each volume has 500,000
directories and 50,000,000 files.
space = (0*100*500,000)+(0*50,000,000)+(3*100*500,000)+((0*50,000,000*100)/10)
(150,000,000) / 1048576 = 143MB
Another Example:
User does automatic backups with 3 different sets - one per volume (3 volume
system). Each volume has 50 million files, and 1 million directories.
space = (3*100*1,000,000)+((1*50,000,000*100)/10)+(0)+((1*50,000,000*100)/10) =
1,239MB or 1.23 GB of index information.

Full backup sets will create an incremental file related to the backup set name. If a
backup set is an incremental, it will find the most recent full incremental index file to use.
Here is a 1024GB (1TB) example for incremental storage of the automatics (assuming
both are full backups):

2 full backup sets * 214,748 directories * 64 bytes per dir avg. =


2*(214,748*64) = 27,487,744 bytes

Plus the index storage:

2 backup sets * number of files * 64 bytes per filename average / compression ratio
2*((10,737,418*64)/10) = 137,438,950 bytes
Plus a single index since the user is doing manuals - and we're assuming the manual
is a full backup:
1 manual backup *((10,737,418*64)/10) = 68,719,475 bytes
233,646,169 / (1024*1024) = 233,646,169 / 1048576
Total /var/backup then is: 222.8 MB

You might also like