home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / mini / multiple.000 < prev    next >
Encoding:
Text File  |  1996-07-11  |  14.1 KB  |  337 lines

  1.  
  2.     Mini_HOWTO: Multi Disk System Tuning
  3.  
  4.     Version 0.2
  5.     Date 960321
  6.     By Stein Gjoen <sgjoen@nyx.net>
  7.  
  8. This document was written for two reasons, mainly because I got hold
  9. of 3 old SCSI disks to set up my Linux system on and I was pondering
  10. how best to utilize the inherent possibilities of parallising in a
  11. SCSI system. Secondly I hear there is a prize for people who write
  12. docs...
  13.  
  14. This is intended to be read in conjunction with the Linux File System
  15. Standard (FSSTD). It does not in any way replace it but tries to
  16. suggest where physically to place directories detailed in FSSTD, both
  17. in terms of drives, partitions, types, RAID, file system (fs),
  18. physical sizes and other parameters that should be considered and
  19. tuned in a linux system, ranging from single home systems to large
  20. servers.
  21.  
  22. This is also a learning experience for myself and I hope I can start
  23. the ball rolling with this Mini-HOWTO and that it perhaps can evolve
  24. into a larger more detailled and hopefully even more correct HOWTO.
  25. Notes in square brackets indicate where I need more information.
  26.  
  27. Note that this is a guide on how to design and map logical partitions
  28. onto multiple disks and tune for performance and reliability, NOT how
  29. to actually partition the disks or format them.
  30.  
  31. This is the first update, still without any inputs...
  32.  
  33. So let's cut to the chase where swap and /tmp are racing along hard
  34. drive...
  35.  
  36. ---------------------------------------------------------------
  37.  
  38. 1. Considerations
  39.  
  40. The starting point in this will be to consider where you are and what
  41. you want to do. The typical home system starts out with existing
  42. hardware and the newly converted will want to get the most out of
  43. existing hardware. Someone setting up a new system for a specific
  44. purpose (such as an Internet provider) will instead have to consider
  45. what the goal is and buy accordingly. Being ambitious I will try to
  46. cover the entire range.
  47.  
  48. Various purposes will also have different requirements regarding file
  49. system placement on the drives, a large multiuser machine would
  50. probably be best off with the /home directory on a separate disk, just
  51. to give an example.
  52.  
  53. In general for performance it is advantageous to split most things
  54. over as many disks as possible but there is a limited number of
  55. devices that can live on a SCSI bus and cost is naturally also a
  56. factor.
  57.  
  58. 1.1 File system features
  59.  
  60. The various parts of FSSTD have different requirements regarding
  61. speed, reliability and size, for instance losing root is a pain but
  62. can easily be recovered. Losing /var/spool/mail is a rather different
  63. issue. Here is a quick summary of some essential parts and their
  64. properties and requirements. [This REALLY need some beefing up]:
  65.  
  66. 1.1.1 Swap
  67.  
  68. Speed:         Maximum! Though if you rely too much on swap you
  69. should consider buying some more RAM.
  70.  
  71. Size:        Quick and dirty algorithm: just as for tea: 16M for
  72. the machine and 2M for each user. Smallest kernel run in 1M but is
  73. tight, use 4M for general work and light applications, 8M for X11 or
  74. GCC or 16M to be comfortable. [The author is known to brew rather
  75. powerful tea...]
  76.  
  77. Reliability:    Medium. When it fails you know it pretty quickly and
  78. failure will cost you some lost work. You save often, don't you?
  79.  
  80. 1.1.2 /tmp and /var/tmp
  81.  
  82. Speed:        Very high. On a separate disk/partition this will
  83. reduce fragmentation generally, though ext2fs is handles fragmentation
  84. rather well.
  85.  
  86. Size:        Hard to tell, small systems are easy to run with few
  87. megs but these are notorious hiding places for stashing files away
  88. from prying eyes and quota enforcements and can grow without control
  89. on larger machines. Suggested: small machine: 8M, large machines up to
  90. 500M (The machine here has 1100 users and 300M /tmp file).
  91.  
  92. Reliability:    Low. Often programs will warn or fail gracefully when
  93. these areas fail or are filled up. Random file errors will of course
  94. be more serious, no matter what file area this is.
  95.  
  96.  (* That was 50 lines, I am home and dry! *)
  97.  
  98. 1.1.3 Spool areas (/var/spool/news, /var/spool/mail)
  99.  
  100. Speed:        High, especially on large news servers. News transfer
  101. and expiring are disk intensive and will benefit from fast drives. 
  102. Print spools: low. Consider RAID0 for news.
  103.  
  104. Size:        For news/mail servers: whatever you can afford. Single
  105. user systems a few megs will be sufficient if you read continuously.
  106. Joining a list server and taking a holiday is on the other hand it not
  107. a good idea.  (Again the machine I use has 100M reserved for the
  108. entire /var/spool)
  109.  
  110. Reliability:    Mail: very high, news: medium, print spool: low. If
  111. your mail is very important (isn't it always?) consider RAID for
  112. reliability. [Is mail spool failure frequent? I have never experienced
  113. it but there are people catering to this market of reliability...]
  114.  
  115. Note:        Some of the news documentation suggests putting all
  116. the .overview files on a drive separate from the news files, check out
  117. the news FAQs for more information.
  118.  
  119. 1.1.4 Home directories (/home)
  120.  
  121. Speed:        Medium. Although many programs use /var for temporary
  122. storage, other such as some newsreaders frequently update files in the
  123. home directory which can be noticeable on large multiuser systems. For
  124. small systems this is not a critical issue.
  125.  
  126. Size:        Tricky! On some systems people pay for storage so this
  127. is usually then a question of economy. Large systems such as nyx.net
  128. (which is a free Internet service with mail, news and WWW services)
  129. run successfully with a suggested limit of 100K per user and 300K as
  130. max. If however you are writing books or are doing design work the
  131. requirements balloon quickly.
  132.  
  133. Reliability:    Variable. Losing /home on a single user machine is
  134. annoying but when 2000 users call you to tell you their home
  135. directories are gone it is more than just annoying. For some their
  136. livelihood relies on what is here. You do regular backups of course?
  137.  
  138. Note:        You might consider RAID for either speed or
  139. reliability. If you want extremely high speed and reliability you
  140. might be looking at other OSes and platforms anyway. (Fault tolerance
  141. etc.)
  142.  
  143. 1.1.5 Main binaries ( /usr/bin and /local/bin)
  144.  
  145. Speed:        Low. Often data is bigger than the programs which are
  146. demand loaded anyway so this is not speed critical. Witness the
  147. successes of life file systems on CD ROM.
  148.  
  149. Size:        The sky is the limit but 200M should give you most of
  150. what you want for a comprehensive system. (The machine I use, including
  151. the libraries, uses about 800M)
  152.  
  153. Reliability:    Low. This is usually mounted under root where all
  154. the essentials are collected. Nevertheless losing all the binaries is
  155. a pain...
  156.  
  157. 1.1.6 Libraries ( /usr/lib and /local/lib)
  158.  
  159. Speed:        Medium. These are large chunks of data loaded often,
  160. ranging from object files to fonts, all susceptible to bloating. Often
  161. these are also loaded in their entirety and speed is of some use here.
  162.  
  163. Size:        Variable. This is for instance where word processors
  164. store their immense font files. [actual sizes, anyone? I'd like data
  165. for GCC related libraries, TeX/LaTeX, X11 and others that can be relevant]
  166.  
  167. Reliability:    Low. See point 1.1.5
  168.  
  169. 1.1.7 Root
  170.  
  171. Speed:        Quite low: only the bare minimum is here, much of
  172. which is only run at startup time.
  173.  
  174. Size:        Quite small. Biggest file is /vmlinuz, unless you have
  175. a large rescue file collection about 4M should be sufficient.
  176.  
  177. Reliability:    High. A failure here will possible cause a lot of
  178. grief and with with rescuing your boot partition. Naturally you do
  179. have a rescue disk?
  180.  
  181. 1.2 Explanation of terms
  182.  
  183. Naturally the faster the better but often the happy installer of Linux
  184. has several disks of varying speed and reliability so even though this
  185. document describes performance as 'fast' and 'slow' it is just a rough
  186. guide since no finer granularity is feasible. Even so there are a few
  187. details that should be kept in mind:
  188.  
  189. 1.2.1 Speed
  190.  
  191. This is really a rather woolly mix of several terms: CPU load, transfer
  192. setup overhead, disk seek time and transfer rate. It is in the very nature
  193. of tuning that there is no fixed optimum, and in most cases price is the
  194. dictating factor. CPU load is only significant for IDE systems where the
  195. CPU does the transfer itself [more details needed here !!] but is generally
  196. low for SCSI, see SCSI documentation for actual numbers. Disk seek time is
  197. also small, usually in the millisecond range. This however is not a problem
  198. if you use command queuing on SCSI where you then overlap commands keeping
  199. the bus busy all the time. News spools are a special case consisting of a
  200. huge number of normally small files so in this case seek time can become
  201. more significant.
  202.  
  203. 1.2.2 Reliability
  204.  
  205. Naturally none wants low reliability disks but one might be better off
  206. regarding old disks as unreliable. Also for RAID purposes (See the relevant
  207. docs) it is suggested to use a mixed set of disks so simultaneous disk
  208. crashes becomes less likely.
  209.  
  210. 1.3 RAID
  211.  
  212. This is a method of increasing reliability, speed or both by using multiple
  213. disks in parallel thereby increasing access time and transfer speed. A
  214. checksum or mirroring system can be used to increase reliability. Large
  215. servers can take advantage of such a setup but it might be overkill for a
  216. single user system unless you already have a large number of disks
  217. available. See other docs and FAQs for more information.
  218.  
  219. 1.4 AFS, Veritas and Other Volume Management Systems
  220.  
  221. Although multiple partitions and disks have the advantage of making for more
  222. space and higher speed and reliability there is a significant snag: if for
  223. instance the /tmp partition is full you are in trouble even if the news spool
  224. is empty, it is not easy to retransfer quotas across disks. Volume management
  225. is a system that does just this and AFS and Veritas are two of the best known
  226. examples. Some also offer other file systems like log file systems and others
  227. optimised for reliability or speed. Note that Versitas is not available (yet)
  228. for Linux and it is not certain they can sell kernel modules without providing
  229. source for their proprietary code, this is just mentioned for information on
  230. what is out there. Still, you can check their web page http://www.veritas.com
  231. to see how such systems function.
  232.  
  233. 1.5 Linux md Kernel Patch
  234.  
  235. There is however one kernel project that attempts to do some of this, md,
  236. which has been part of the kernel distributions since 1.3.69. Currently
  237. providing spanning and RAID it is still in early development and people
  238. reporting varying degrees of success as well as total wipe out. Use with
  239. caution.
  240.  
  241. 1.6 General File System Consideration
  242.  
  243. In the Linux world ext2fs is well established as a general purpose system. 
  244. Still for some purposes others can be a better choice. News spools lend
  245. themselves to a log file based system whereas high reliability data might
  246. need other formats. This is a hotly debated topic and there are currently
  247. few choices available but work is underway. [I believe someone from Yggdrasil
  248. mentioned a log file based system once, details? And AFS is available to
  249. Linux I think, sources anyone?]
  250.  
  251. There is room for access control lists (ACL) and other unimplemented
  252. features in the existing ext2fs, stay tuned for future updates. There has
  253. been some talk about adding on the fly compression too.
  254.  
  255. DouBle already features file compression with some limitations.
  256. Zlibc adds transparent on-the-fly decompression of files as they load.
  257.  
  258. Also there is the user file system that allows ftp based file system and
  259. some compression (arcfs) plus fast prototyping and many other features.
  260.  
  261.  
  262. 2 Disk Layout
  263.  
  264. With all this in mind we are now ready to embark on the layout [and no
  265. doubt controversy]. I have based this on my own method used when I got hold
  266. of 3 old SCSI disks and boggled over the possibilities.
  267.  
  268. 2.1 Selection
  269.  
  270. Determine your needs and set up a list of all the parts of the file system
  271. you want to be on separate partitions and sort them in descending order of
  272. speed requirement and how much space you want to give each partition.
  273.  
  274. If you plan to RAID make a not of the disks you want to use and what
  275. partitions you want to RAID. Remember various RAID solutions offers
  276. different speeds and degrees of reliability.
  277.  
  278. (Just to make it simple I'll assume we have a set of identical SCSI disks
  279. and no RAID)
  280.  
  281. 2.2 Mapping
  282.  
  283. Then we want to place the partitions onto physical disks. The point of the
  284. following algorithm is to maximise parallelizing and bus capacity. In this
  285. example the drives are A, B and C and the partitions are 987654321 where 9
  286. is the partition with the highest speed requirement. Starting at one drive
  287. we 'meander' the partition line over and over the drives in this way:
  288.  
  289.     A : 9 4 3
  290.     B : 8 5 2
  291.     C : 7 6 1
  292.  
  293. This makes the 'sum of speed requirements' the most equal across each
  294. drive.
  295.  
  296. 2.3 Optimizing
  297.  
  298. After this there are usually a few partitions that have to be 'shuffled' over
  299. the drives either to make them fit or if there are special considerations
  300. regarding speed, reliability, special file systems etc. Nevertheless this
  301. gives [what this author believes is] a good starting point for the complete
  302. setup of the drives and the partitions. In the end it is actual use that will
  303. determine the real needs after we have made so many assumptions. After
  304. commencing operations one should assume a time comes when a repartitioning
  305. will be beneficial.
  306.  
  307. 3 Further Information
  308.  
  309. There is wealth of information one should go through when setting up a
  310. major system, for instance for a news or general Internet service provider. 
  311. The FAQs in the following groups are useful:
  312.  
  313.     News groups:
  314. comp.arch.storage, comp.sys.ibm.pc.hardware.storage, alt.filesystems.afs,
  315. comp.periphs.scsi ...
  316.     Mailing lists:
  317. raid, scsi ...
  318.  
  319. many mailing lists are at vger.rutgers.edu but this is notoriously
  320. overloaded, try to find a mirror. There are some lists mirrored at
  321. http://www.redhat.com [more references please!].
  322.  
  323. [much more info needed here]
  324.  
  325. 4 Concluding Remarks
  326.  
  327. Disk tuning and partition decisions are difficult to make, and there are no
  328. hard rules here. Nevertheless it is a good idea to work more on this as the
  329. payoffs can be considerable. Maximizing usage on one drive only while the
  330. others are idle is unlikely to be optimum, watch the drive light, they are not
  331. there just for decoration. For a properly set up system the lights should look
  332. like Christmas in a disco. Linux offers software RAID but also support for
  333. some hardware base SCSI RAID controllers. Check what is available. As your
  334. system and experiences evolve you are likely to repartition and you might look
  335. on this document again. Additions are always welcome.
  336.  
  337.