3

I work as a enterprise Web App developer. Atm, I only work on the server side. I develop EWA using either Java either JavaScript. My development stack includes :

  • Eclipse
  • Maven
  • JoNAS Web Server (or Tomcat)
  • SoapUI
  • NodeJS
  • Sublime Text
  • cURL
  • zsh (for shell scripts).

My machine runs Ubuntu 16.04 LTS using default partitioning scheme for now (as until today I only had 1TG hard drive).

My computer specs summary : https://0bin.net/paste/WrztIvzvGsGl0K1q#AWfh4Bvgnp3WnyjkzGxuLQPWSIf5FuihrUY9s1VPreD

Output of du -sh /* 2> /dev/null

14M   /bin
147M  /boot
184K  /dev
22M   /etc
45G   /home
0     /initrd.img
0     /initrd.img.old
801M  /lib
4,0K  /lib64
16K   /lost+found
16K   /media
16K   /mnt
4,0K  /mnt1
4,0K  /mnt_name
2,4G  /opt
0     /proc
490M  /root
9,7M  /run
14M   /sbin
4,0K  /snap
12K   /soft
4,0K  /srv
0     /sys
112K  /tmp
6,9G  /usr
1,4G  /var
0     /vmlinuz
0     /vmlinuz.old
4,0K  /yourdev-crontab

Today, I received a new SSD drive which is 256GB. So I need to think about my partitioning scheme in order to increase performance if possible.

All my dev stack (except command lines tools) are stored either in /opt or /usr/local folders.

Question is : how should i partition my hard drives so that i benefits from the SSD speed ? (what should i put on the SSD drive what should I put on the 1TG drive ? Should i put my /home folder in the SSD or not ? Should i put the JVM on the SSD or should i use a RAMDISK...)

In summary how to partition my computer to optimize it for Web App Development ?

anchnk
  • 53
  • What is the capacity of your SSD and how much do your data take? You could paste the output of du -sh /* 2> /dev/null to tell us the sizes of directories in /. – Melebius Sep 20 '16 at 13:01
  • Updated the OP in order to include your suggestions – anchnk Sep 20 '16 at 13:10
  • The listing is not complete, missing especially /opt, /var, /usr. If the command finishes prematurely, run it without 2> /dev/null to see error output. – Melebius Sep 20 '16 at 13:16
  • Yeah sorry it's still in progress will keep it posted once it's done – anchnk Sep 20 '16 at 14:00
  • Should be complete now (had to umount network shares that were really slow to crawl) – anchnk Sep 20 '16 at 14:29
  • Another option instead of static partitioning I explored recently is (encrypted) LVM cache/dm-cache with HDD+SSD. I usually don't need more than 30 GB for my root partition, so I had plenty of remaining storage on the SSD to use as cache for frequently used blocks on the HDD where I have VMs. Downsides: you need to reformat your HDD (and move data temporarily to another drive), you can't use the cache as additional storage space (1TB+0.25TB≠1.25TB, but you are more flexible with LVM). But I wanted to wait few more weeks before posting instructions here – LiveWireBT Sep 20 '16 at 16:30
  • Just give me a few hours of sleep, I'll see what I can do for you. In the mean time could you tell me if you plan to use encryption? Are you already? Do you use ecryptfs for home or LUKS+pam_mount? – LiveWireBT Sep 20 '16 at 16:41
  • Thank you for your inputs, no encryption are used at all. What does matter here is simply performance and speed. It's a workstation within a corporate environment. What I am seeking is speed in launching the applications I work with and speed apps I develop's compile time, deployment on the local machine and such – anchnk Sep 20 '16 at 16:53

2 Answers2

1

I think you can put your /home on your old hard disk. The rest of the system can be put on your new SSD drive.

Alternatively, if you also want to speed up some of the files in the /home directory (maybe some project files), you can put /home on your SSD and mount your HDD under /media.

0

SSD caching with LVM

From the data you provided everything should fit nicely on the SSD with enough free space, your setup probably even fits on half the space. As I wrote in a comment even with packages like Lyx/TeX I don't need more than 30 GB for my root partition except /home.

I assume up until now you had only a root partition that contained all the data and as you said you are currently not using encryption. You can continue running this setup on the SSD and set up lvmcache, dedicating half or less the size of the SSD as a cache for the HDD to help improve reads from the HDD for frequently used blocks. Pairing a 1TB HDD with about 100 GB of Flash storage doesn't seem to be unusual by the way and can be quite a lot, but it depends on your usage patterns.

I recently set up lvmcache myself and posted a Q&A (sorry for the wait) trying to explain the setup as brief and with less hard coded values as possible. Since you don't want encryption you can skip the cryptsetup steps and use the raw devices (/dev/sd*) instead of mapper devices for the encrypted volumes (/dev/mapper/).

Things to consider:

  • SSD caching is a middle ground between entire SSD or HDD storage setups for improved read performance. Write performance is limited to the slowest device which might not always be the HDD (though your SSD is at least one class above my current example).
  • The performance gain depends on your usage pattern, running VMs so far had mostly positive effects for me, but your mileage may vary.
  • Simply treat the HDD with the cache as another data volume mounted to /media as described by Liu. Put all the content you don't need frequently or which has grown to big in /opt, /usr/local or /home on the HDD and symlink to it from the SSD
  • For fast reads and writes you should consider a ramdisk, ccache and the likes.
LiveWireBT
  • 28,763