Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Monday, April 19, 2010

Sun Fire V120 as NAS part 6: Network shares and RAM upgrade

Ok. Time to start some file sharing protocols.

First the easy part: NFS.
Solaris comes with NFS4 (backwards compatible with NFS2 and NFS3). Not very important in a normal home but in my case, this is the best option to share information with my SGI boxes. Only three steps are needed to start sharing, Fantastic!

1. Make writable to everybody the folder where I want to share. I use the same array than before:
# chmod 777 /fsshared
2. Add the share information to the file /etc/dfs/dfstab
#       Place share(1M) commands here for automatic execution
#       on entering init state 3.
#
#       Issue the command 'svcadm enable network/nfs/server' to
#       run the NFS daemon processes and the share commands, after adding
#       the very first entry to this file.
#
#       share [-F fstype] [ -o options] [-d ""] [resource]
#       .e.g,
#       share  -F nfs  -o rw=engineering  -d "home dirs"  /export/home2
share -F nfs -o rw -d "fsshared V120" /fsshared
3. Start sharing:
# shareall
The dfstab entry goes:
  • -F nfs .- Type of sharing.
  • -o rw .- The options. Here I only used read-write but there is a lot more (including loggin), but I just don't need.
  • -d "fsshared V120" .- Obviously is only a comment.
  • /fsshared .- Here comes the folder I want to export.
Here some captures from my Fuel mounting the exported folder of the Sun Fure V120:

Second part is SAMBA!
This is the standard Windows protocol. At the time the most important in any home or company. From a lot of time ago samba.org is publising the source code and it's widely used but all the test I did before (and some test done by friends) are telling Samba is slow, in Solaris and in Linux.

Configure Samba in Solaris is not as easy as I was thinking before to use it.
1. Check if Samba is installed. Well, installing Solaris with OEM option, Samba must be installed:
# /usr/sfw/sbin/smbd -V
Version 3.0.35
2. Now we have to create the smb.conf file. I copied the exampled provided with the Solaris installation:
# cd /etc/sfw
# cp smb.conf-example smb.conf
3. Edit the configuratin file. I modified three parts: The allowed ip ranges (my network subnet and localhost):
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
   hosts allow = 192.168.2. 127.
 Set the Windows workgroup name:
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORKGROUP
And the last one, the shared folder. I want the folder open read-write to everybody, then the guest ok option must be set and the guest only option must be removed! The docs says guest only is discarded with guest ok but in my case guest ok was discarded with both options in the configuration of the folder.


# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
[public]
   path = /fsshared
   public = yes
   guest ok = yes
   writable = yes
   printable = no
   browseable = yes
4. Test the configuration file:
# /usr/sfw/bin/testparm

Load smb config files from /etc/sfw/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
5. Add a user to the Samba database:
#  /usr/sfw/bin/smbpasswd -a admin
New SMB password:
Retype new SMB password:
Added user admin.
6. The last part must be start the samba service:
# svcadm enable samba
----------------------------------------------------------------------------------------------------------
UPDATE: 2010/09/08
7. Now Samba is working but I can't see the computer in the Windows Explorer (or other smb bowsers): The last step is activate WINS:
# svcadm enable wins

Here you have the old post part (italic letter). NOT NECESSARY.
A new test showed that I don't need to do the next part. At the end 
but in my case it didn't work. After some googling I found this guide related to Solaris u4, and I followed. Samba didn't start and after a new search I found a fault in my smb.conf: I writed /fssaredc instead of the name of my shared folder.
Now I have two commands to start samba:
# svcadm enable samba:smbd
# svcadm enable samba:nmbd
End of the update
----------------------------------------------------------------------------------------------------------
But it's working:
And here comes the bad part. I only get 4.3 MB/s downloading the test file via FTP and 1.9 MB/s via Samba! The V120 is connected to my main router via a non manageable HP ProCurve gigabit switch and the client is a Dell Precsion 390 with the onboard Broadcom gigabit network chipset. I did some checks in the V120 network port configuration but I didn't find anything wrong. Well, I will check later. Anyway I have a Quad GigaSwift PCI card at the mail coming home.

RAM tests.
Thursday arrived some more RAM sticks, 4x1GB ECC registered sticks!!!
I did various test with different amount of memory: 512 MB (one stick that came with the server), 2 GB and 4 GB.

                                 512MB         2 GB        4GB
-----------------------------------------------------------------------
From RAID5 to system disk.      12.8 MB/s    17.8 MB/s   26.9 MB/s
From system disk to RAID5.      11.3 MB/s    18.6 MB/s   21.6 MB/s
From RAID5 to disk 2.           12,5 MB/s    20.9 MB/s   32.0 MB/s

I was expecting a great improvement from 512 MB to 2 Gb, but I also discovered a great rise in performance with 4 GB using the RAID5 array. Yes, ZFS needs a lot of memory!
Note that tests are done by hand and I only did the test one or two times but are enough for comparision. At least for me!

Tuesday, March 30, 2010

Sun Fire V120 as NAS part 4: Testing ZFS RAID-Z

I wanted to test a RAID5 configuration but having my server booting from a ZFS disk, seems that the Solaris Volume Manager (SVM) databases are not created and I can't use it. Anyway my main project is focuses in ZFS. Start!!!!!
From the SSM software or the format utility I get the disks names (SCSI nodes 1 to 3, scsi bus 2 - onle array disk):
  • c2t1d0
  • c2t2d0
  • c2t3d0

Create a ZFS RAIDZ array is easy, just type:
# zpool create fsshared raidz c2t1d0 c2t2d0 c2t3d0
Now I have a new folder named /fsshared:
# ls
bin       dev       export    kernel    mnt       platform  sbin      usr
boot      devices   fsshared  lib       net       proc      system    var
cdrom     etc       home      lom2      opt       rpool     tmp       vol
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
fsshared                   89,9K  33,1G  28,0K  /fsshared
rpool                      4,67G  28,6G    97K  /rpool
rpool/ROOT                 3,67G  28,6G    21K  legacy
rpool/ROOT/s10s_u8wos_08a  3,67G  28,6G  3,67G  /
rpool/dump                  512M  28,6G   512M  -
rpool/export                 44K  28,6G    23K  /export
rpool/export/home            21K  28,6G    21K  /export/home
rpool/swap                  512M  28,8G   230M  -
At the list you can see the main boot zfs systems named as root and my new fsshared array. Now it's time to check speed.
Create a new 2 GB file and watch how the array free space decreases:
# cd /fsshared
# mkfile 2g testfile
# ls
testfile
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
fsshared                   2,00G  31,1G  2,00G  /fsshared
rpool                      4,74G  28,5G    97K  /rpool
rpool/ROOT                 3,74G  28,5G    21K  legacy
rpool/ROOT/s10s_u8wos_08a  3,74G  28,5G  3,74G  /
rpool/dump                  512M  28,5G   512M  -
rpool/export                 44K  28,5G    23K  /export
rpool/export/home            21K  28,5G    21K  /export/home
rpool/swap                  512M  28,8G   230M  -
To check the write speed I copied the testfile to / and measured the time manualy
# cp /fsshared/testfile /
2048 MB  -  161s  - 12.8 MB/s
# rm /fsshared/testfile
# cp /testfile /fsshared
2048 MB  -  181 s  -  11.3 MB/s
This is not a good result and I'm start to think that the small amount of  RAM in the server is one of the causes (with the slow CPU of course). Writing from the main disk to the array is slower than the reverse option. This speed is not fantastic but it's a write speed, now I need a gigabit card to check read speed. If read performance is ok, the V120 will be enough as NAS.

A new test copying the same file from the array to the disk 2 of the server:
# zpool create disc2 c1t1d0
# cp /fsshared/testfile /disc2
2048 MB  -  164 s  -  12,5 MB/s
Not better results here... And from the main disk to the second one of the server? And reverse?

# rm /disc2/testfile
# cp /testfile /disc2
2048 MB  -  121s  - 16.9 MB/s

Wow... Maybe the ZFS RAID calculations are too heavy for this server.
 Ok. Next must be test NFS, FTP and SMB trasfer results.