Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2008 13:29:55 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Danny Do <danhdo@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Hard disk bottle neck.
Message-ID:  <48DF78C3.9080401@infracaninophile.co.uk>
In-Reply-To: <00d101c92154$691f53c0$3b5dfb40$@com>
References:  <00d101c92154$691f53c0$3b5dfb40$@com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigECF6016D7D5E6D5C89AE0FDE
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Danny Do wrote:
> Hi guys,
>=20
> =20
>=20
> I have this problem for years but couldn't find a way to solve it.
>=20
> I have a file server handling large files from 1MByte to 1GByte.=20
>=20
> Server Info:
> FreeBSD 6.2=20
> Apache 2.2.9
>=20
> DELL PowerEdge 1850
> 2GB RAM (only 184MB is active)
> 6x300MB SCSI 10K RPM RAID5
> Gigabit Ethernet Connection
>=20
> My server can output NO MORE than 60Mbps (read only).=20
>=20
> The bottle neck is the hard disk. If I use ONE connection to download f=
ile
> from my server, the speed can go up to about 400Mbps.=20
>=20
> If I let visitors download using multiple connections, the server canno=
t
> output more than 60Mbps.=20
>=20
> My service is similar to rapidshare/megaupload, I am wondering how they=

> configure their servers?
>=20
> If I recall correctly, it doesn't cost much time to read the data from =
the
> disk but it does cost a lot of time to seek for the data. Correct me if=
 I am
> wrong, if I increase the read buffer size, there would be less disk see=
k
> (disk access). Let's say the read buffer is 64K, if I increase it to 64=
0K,
> the disk seek would reduce by 90%. Thus, more data can be read from the=
 hard
> drive.
>=20
> What should I do now?

Try some different webservers. Apache is great, but it is designed to
be maximally flexible and capable of doing anything you can imagine
rather than to be absolutely as fast as possible.

There are some light-weight servers which have put work into optimizing
delivery of static content -- usually spoken of in the context of serving=
=20
images but any static files will be suitable material.  Personally, I=20
really like nginx for this.  Lots of people go for lighttpd and there are=

a number of other alternatives in ports.

Also, depending on exactly how much content you have to serve and whether=

certain items are very much more popular than others, a reverse proxy / m=
emory cache (a.k.a http accelerator) may help.  varnish is the obvious
candidate here, but you'll have to experiment a bit to see what the optim=
al
settings are and if it actually helps at all.

If your website runs using a scripting language such as PHP, then another=

possibility is memcached -- although described as a cache for dynamically=

generated pages, it can cache just about anything, but you will need some=

sort of scripting language to interface to it from your web server.  Ther=
e
are memcached APIs for all popular languages and probably a few you've=20
never heard of...

The various caching strategies basically work because they keep recently
accessed files in RAM, avoiding an expensive round-trip to the HDD to
retrieve the data (memory access takes nano- or micro- seconds: disk=20
accesses take milliseconds).  Of course, the OS itself also does exactly =

the same thing in a general way, and FreeBSD is already very good in this=
=20
respect.  Caching  software however gives you more control over what gets=
=20
cached and for how long,  enabling you to tune this specific application =

for maximum performance.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW


--------------enigECF6016D7D5E6D5C89AE0FDE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkjfeMoACgkQ8Mjk52CukIyrswCfWjuor/UMlEofLjPCMnEkzxqQ
N1IAoIIw0Y4Ay48yuXTnwrmvpnXcZ+IE
=Ba6b
-----END PGP SIGNATURE-----

--------------enigECF6016D7D5E6D5C89AE0FDE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48DF78C3.9080401>