Lab Machines

How to Improve Speed on Netboot Machines

Check your exports for /vol/-paths

$ source ~/.bashrc && export | grep "/vol/"
$ grep "/vol/" ~/.{xinitrc,bashrc,profile,xprofile,xsessionrc,shenv,gnomerc}

Remove every unnecessary exports

Remove every unnecessary exports in ~/.{xinitrc,bashrc,profile,xprofile,xsessionrc,shenv,gnomerc} (if any of them exists), for example this one:

export PATH="/vol/matlab/bin:$PATH"

Use RCINFO and remove all packages

Only select packages, your daily work depends on. Everything else will make your system slower!

After that logout, login and again: check your exports.

Experimental and Unsupported Methods

Warning

You can mess up things if you manipulate your ~/.xinitrc or ~/.bashrc! Carfully think about all changes you make, as you won’t get any support for that!

Put your IDE into a RAM disk.

Just create a new bash function in your ~/.bashrc. You’ll need to start your IDE from bash from now on, of course.

This is an example for Netbeans:

function netbeans {
  version="8.2"
  idename="netbeans"
  RAMDISK=/dev/shm/${USER}
  subver="201609300101-javase"  # Get the subver from https://netbeans.org/downloads/zip.html
  url="http://download.netbeans.org/netbeans/${version}/final/zip/netbeans-${version}-${subver}.zip"

  mkdir -p ${RAMDISK}

  test -f "${HOME}/${idename}-${version}.zip"  || wget -c ${url} -O ${HOME}/${idename}-${version}.zip
  if [ ! -d "${RAMDISK}/${idename}" ]; then
    unzip -q ${HOME}/${idename}-${version}.zip -d ${RAMDISK}/
  fi
  ${RAMDISK}/${idename}/bin/${idename}
  rm -r ${RAMDISK}/${idename}/
}
export -f netbeans

Another example for PyCharm CE (as a template for all JetBrains IDEs):

function pycharm {
  version="2016.3.2"
  idename="pycharm-community"
  RAMDISK=/dev/shm/${USER}
  url="https://download-cf.jetbrains.com/python/${idename}-${version}.tar.gz"

  mkdir -p ${RAMDISK}

  test -f "${HOME}/${idename}-${version}.tar.gz"  || wget -c ${url} -O ${HOME}/${idename}-${version}.tar.gz
  if [ ! -d "{$RAMDISK}/${idename}-${version}" ]; then
    tar -xf ${HOME}/${idename}-${version}.tar.gz -C ${RAMDISK}
  fi
  ${RAMDISK}/${idename}-${version}/bin/pycharm.sh
  rm -r $RAMDISK/${idename}-${version}/
}
export -f pycharm

(/!\ Dangerous) Use a Custom ~/.xinitrc

This custom ~/.xinitrc will make use of the system’s RAM disk. It will delete files in the RAM disk on logout, so be careful not to put important logs or similar things there. Of course you will need to select the session type “custom”.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
umask 077

## create ramdisk-folders, remove originals, link 'em
mkdir -p /dev/shm/$USER/.cache 
mkdir -p /dev/shm/$USER/.m2 
mkdir -p /dev/shm/$USER/.ros 
mkdir -p /dev/shm/$USER/logs 

rm -r $HOME/.cache $HOME/.m2 $HOME/.ros $HOME/logs 

ln -s /dev/shm/$USER/.cache 
ln -s /dev/shm/$USER/.m2 
ln -s /dev/shm/$USER/.ros 
ln -s /dev/shm/$USER/logs 

# for the internal TechFak maven repository:
m2=$(cat <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
      <profile>
          <!-- Change according to your distribution name -->
          <id>toolkit-nightly</id>
          <activation>
              <activeByDefault>true</activeByDefault>
          </activation>
          <repositories>
              <repository>
                  <!-- change to your distribution name -->
                  <id>toolkit-nightly</id>
                  <name>toolkit repository</name>
                  <!-- Assuming that you have installed the distribution to \$prefix.
                       Replace the variable with the real path here!
                       This should result in 3 consecutive slashes after file! -->
                  <url>file://\${prefix}/share/repository</url>
                  <layout>default</layout>
                  <releases>
                      <updatePolicy>always</updatePolicy>
                      <enabled>true</enabled>
                  </releases>
                  <snapshots>
                      <updatePolicy>always</updatePolicy>
                      <enabled>true</enabled>
                  </snapshots>
              </repository>
          </repositories>
      </profile>
  </profiles>
</settings>
EOF
)

echo $m2 > /dev/shm/$USER/.m2/settings.xml 

startxfce4

## purge ramdisk after logout
rm -rf /dev/shm/$USER