https://wiki.archlinux.org/api.php?action=feedcontributions&user=Overand&feedformat=atomArchWiki - User contributions [en]2024-03-28T21:08:38ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=355379Music Player Daemon2015-01-04T17:57:23Z<p>Overand: Missing quotes on music directory example</p>
<hr />
<div>[[Category:Player]]<br />
[[de:Music Player Daemon]]<br />
[[es:Music Player Daemon]]<br />
[[fr:MPD]]<br />
[[it:Music Player Daemon]]<br />
[[ja:Music Player Daemon]]<br />
[[nl:Music Player Daemon]]<br />
[[pl:Music Player Daemon]]<br />
[[ru:Music Player Daemon]]<br />
[[sr:Music Player Daemon]]<br />
[[tr:Music_Player_Daemon]]<br />
[[zh-CN:Music Player Daemon]]<br />
{{Related articles start}}<br />
{{Related|MPD/Tips and Tricks}}<br />
{{Related|MPD/Troubleshooting}}<br />
{{Related articles end}}<br />
'''[http://www.musicpd.org/ MPD]''' ('''m'''usic '''p'''layer '''d'''aemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database all while using very few resources. In order to interface with it, a separate [[#Clients|client]] is needed.<br />
<br />
== Installation ==<br />
<br />
The latest stable version of {{Pkg|mpd}} is available in the [[official repositories]].<br />
<br />
Should users wish to run an experimental version, the [[AUR]] offers several from which to choose. For example, {{AUR|mpd-git}}.<br />
{{Note|An alternative plug-in based implementation called [http://www.mopidy.com Mopidy] exists. It is available in the AUR as {{AUR|mopidy}} and {{AUR|mopidy-git}}. Be warned that is not a complete MPD [http://docs.mopidy.com/en/latest/ext/mpd/#limitations drop-in relacement].}}<br />
<br />
== Setup ==<br />
<br />
MPD is able to run locally (per user settings), globally (settings apply to all users), and in multiple instances. The way of setting up mpd depends on the way it is intended to be used: a local configuration may prove more useful on a desktop system, for example.<br />
<br />
In order for MPD to be able to play back audio, [[ALSA]] or [[OSS]] (optionally with [[PulseAudio]]) needs to be setup and working.<br />
<br />
MPD is configured in {{ic|mpd.conf}}. The location of this file depends on how you want to run MPD (see the sections below). These are commonly used configuration options:<br />
* {{ic|pid_file}} - The file where mpd stores its process ID<br />
* {{ic|db_file}} - The music database<br />
* {{ic|state_file}} - MPD's current state is noted here<br />
* {{ic|playlist_directory}} - The folder where playlists are saved into<br />
* {{ic|music_directory}} - The folder that MPD scans for music<br />
* {{ic|sticker_file}} - The sticker database<br />
<br />
{{Note|The files must already exist (the path is specified in the configuration file) with proper permissions, otherwise MPD will fail to start.}}<br />
<br />
=== Global configuration ===<br />
<br />
{{Warning|Users of PulseAudio with a global mpd have to implement a [[Music Player Daemon/Tips and tricks#Local (with separate mpd user)|workaround]] in order to run mpd as its own user!}}<br />
<br />
The default {{ic|/etc/mpd.conf}} keeps the setup in {{ic|/var/lib/mpd}} and uses ''mpd'' as default user. However, {{ic|/var/lib/mpd}} is owned by ''root'' by default, we need to change this so ''mpd'' can write here:<br />
# chown -R mpd /var/lib/mpd<br />
<br />
Edit {{ic|/etc/mpd.conf}} and add a {{ic|music_directory}} line with the path to your music directory:<br />
music_directory "/path/to/music"<br />
<br />
==== Music directory ====<br />
<br />
MPD needs to have {{ic|+x}} permissions on ''all'' parent directories to the music collection. <br />
<br />
If the music directory is located outside of {{ic|/var/lib/mpd}}, you will most likely need to remount the music directory under a directory that the MPD user (''mpd'' by default) has access to:<br />
# mkdir /var/lib/mpd/music<br />
# echo "/path/to/music/dir /var/lib/mpd/music none bind" >> /etc/fstab<br />
# mount -a<br />
Also see [https://bbs.archlinux.org/viewtopic.php?id=86449 this forum thread].<br />
<br />
An additional solution would be to just create a symbolic link into {{ic|/var/lib/mpd/music}}.<br />
# mkdir /var/lib/mpd/music<br />
# ln -s /path/to/music/dir /var/lib/mpd/music/<br />
<br />
If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Start MPD ====<br />
<br />
MPD can be controlled with {{ic|mpd.service}} [[systemd#Using units|using systemd]]. The first startup can take some time as MPD will scan your music directory.<br />
<br />
Test everything by starting a client application ({{Pkg|ncmpc}} is a light and easy to use client), and play some music!<br />
<br />
===== Socket activation =====<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} '''and''' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/etc/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
==== Configure audio ====<br />
<br />
To change the volume for mpd independent from other programs, uncomment or add this switch in mpd.conf:<br />
{{hc|/etc/mpd.conf|<br />
mixer_type "software"<br />
}}<br />
<br />
Users of [[ALSA]] will want to have the following device definition, which allows software volume control in the MPD client to control the volume separately from other applications.<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "My Sound Card"<br />
mixer_type "software" # optional<br />
}<br />
}}<br />
<br />
Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "pulse audio"<br />
}<br />
}}<br />
<br />
PulseAudio supports multiple advanced operations, e.g. transferring the audio to a different machine. For advanced configuration with MPD see [http://mpd.wikia.com/wiki/PulseAudio Music Player Daemon Community Wiki].<br />
<br />
==== Changing user ====<br />
<br />
Changing the group that MPD runs as may result in errors like {{ic|output: Failed to open "My ALSA Device"}}, {{ic|[alsa]: Failed to open ALSA device "default": No such file or directory}} or {{ic|player_thread: problems opening audio device while playing "Song Name.mp3"}}.<br />
<br />
This is because the MPD users need to be part of the ''audio'' group to access sound devices under {{Ic|/dev/snd/}}. To fix it add user make the MPD user part of the ''audio'' group:<br />
# gpasswd -a '''mpd''' audio<br />
<br />
==== Timeline of MPD startup ====<br />
<br />
To depict when MPD drops its superuser privileges and assumes those of the user set in the configuration, the timeline of a normal MPD startup is listed here:<br />
<br />
# Since MPD is started as root by systemd, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the user variable in the {{ic|/etc/mpd.conf}} file, and changes from root to this user.<br />
# MPD then reads the contents of the {{ic|/etc/mpd.conf}} file and configures itself accordingly.<br />
<br />
Notice that MPD changes the running user from root to the one named in the {{ic|/etc/mpd.conf}} file. <br />
This way, uses of {{ic|~}} in the configuration file point correctly to the home user's directory, and not root's directory. <br />
It may be worthwhile to change all uses of {{ic|~}} to {{ic|/home/username}} to avoid any confusion over this aspect of MPD's behavior.<br />
<br />
=== Local configuration (per user) ===<br />
<br />
MPD can be configured per user (rather than the typical method of configuring MPD globally). Running MPD as a normal user has the benefits of:<br />
<br />
* A single directory {{ic|~/.config/mpd/}} (or any other directory under {{ic|$HOME}}) that will contain all the MPD configuration files.<br />
* Easier to avoid unforeseen read/write permission errors.<br />
<br />
Good practice is to create a single directory for the required files and playlists. It can be any directory for which you have read and write access, e.g. {{ic|~/.config/mpd/}} or {{ic|~/.mpd/}}. This section assumes it is {{ic|~/.config/mpd/}}, which corresponds to the default value of {{ic|$XDG_CONFIG_HOME}} (part of [http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification]).<br />
<br />
MPD searches for a config file in {{ic|$XDG_CONFIG_HOME/mpd/mpd.conf}} and then {{ic|~/.mpdconf}}. It is also possible to pass other path as command line argument.<br />
<br />
Copy the example configuration file to desired location, for example:<br />
<br />
$ cp /usr/share/doc/mpd/mpdconf.example ~/.config/mpd/mpd.conf<br />
<br />
Edit {{ic|~/.config/mpd/mpd.conf}} and specify the required files:<br />
<br />
{{hc|~/.config/mpd/mpd.conf|<br />
# Required files<br />
db_file "~/.config/mpd/database"<br />
log_file "~/.config/mpd/log"<br />
<br />
# Optional<br />
music_directory "~/Music"<br />
playlist_directory "~/.config/mpd/playlists"<br />
pid_file "~/.config/mpd/pid"<br />
state_file "~/.config/mpd/state"<br />
sticker_file "~/.config/mpd/sticker.sql"<br />
}}<br />
<br />
Create all the files and directories as configured above:<br />
<br />
$ mkdir ~/.config/mpd/playlists<br />
$ touch ~/.config/mpd/{database,log,pid,state,sticker.sql}<br />
<br />
When the paths of required files are configured, MPD can be started. To specify custom location of the configuration file:<br />
<br />
$ mpd ''config_file''<br />
<br />
==== Autostart on tty login ====<br />
<br />
To start MPD on login add the following to {{ic|~/.profile}} (or another [[Autostarting#Shells|autostart file]]):<br />
<br />
# MPD daemon start (if no other user instance exists)<br />
[ ! -s ~/.config/mpd/pid ] && mpd<br />
<br />
==== Autostart in X ====<br />
<br />
If you use a [[Desktop environment|desktop environment]], place the following file in {{ic|~/.config/autostart/}}:<br />
{{hc|~/.config/autostart/mpd.desktop|<nowiki><br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=Music Player Daemon<br />
Comment=Server for playing audio files<br />
Exec=mpd<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=false<br />
</nowiki>}}<br />
<br />
If you do not use a DE, place the line from [[#Autostart on tty login]] in your [[Autostarting#Graphical|autostart file]].<br />
<br />
==== Autostart with systemd ====<br />
<br />
{{Note|It is assumed that you already have systemd user-session manager running. See the [[systemd/User]] page for details.}}<br />
<br />
The package {{Pkg|mpd}} provides user service file in {{ic|/usr/lib/systemd/user/mpd.service}}. The configuration file is expected to exist either in {{ic|~/.mpdconf}} or {{ic|~/.config/mpd/mpd.conf}}, see [[systemd#Editing provided unit files]] if you would like to use different path. The process is not started as root, so you should not use the {{ic|user}} and {{ic|group}} variables in the MPD configuration file, the process already has user permissions and therefore it is not necessary to change them further.<br />
<br />
All you have to do is enable and start the {{ic|mpd}} [[systemd/User#User Services|user service]].<br />
<br />
{{Note|<br />
* {{Pkg|mpd}} provides also system service file in {{ic|/usr/lib/systemd/system/mpd.service}}, but as the process is started as root, it does not read the user configuration file and falls back to {{ic|/etc/mpd.conf}}. [[#Global configuration|Global configuration]] is described in other section.<br />
* Make sure to disable every other method of starting mpd you used before.<br />
}}<br />
<br />
==== Scripted configuration ====<br />
<br />
Rasi has written a script that will create the proper directory structure, configuration files and prompt for the location of the user's Music directory; it can be downloaded [http://dl.53280.de/mpdsetup.sh here].<br />
<br />
=== Multi-mpd setup ===<br />
<br />
==== Running an icecast server ====<br />
<br />
For a second MPD (e.g., with icecast output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on); using the same directory paths for the music and playlist directories would ensure that this second mpd would use the same music collection as the first one e.g., creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above. (Just be sure to have a different port number, so as to not conflict with the first mpd daemon).<br />
<br />
==== Satellite setup ====<br />
<br />
The method above works, but at least in theory could lead to issues with the database, when both mpd instances try to write to the same database file. MPD has a [http://www.musicpd.org/doc/user/advanced_config.html#satellite satellite mode] where one instance can receive the database from an already running mpd instance.<br />
<br />
in your config-icecast add this, where host and port reflect your primary mpd server.<br />
<br />
{{bc|<br />
database {<br />
plugin "proxy"<br />
host "localhost"<br />
port "6600"<br />
}<br />
}}<br />
<br />
== Clients ==<br />
<br />
A separate client is needed to control mpd. See a long list of clients at the [http://mpd.wikia.com/wiki/Clients mpd wiki]. Popular options are:<br />
<br />
=== Console ===<br />
<br />
*{{App|mpc|Command line user interface for MPD server|http://www.musicpd.org/clients/mpc/|{{Pkg|mpc}}}}<br />
*{{App|ncmpc|Ncurses client for mpd|http://www.musicpd.org/clients/ncmpc/|{{Pkg|ncmpc}}}}<br />
*{{App|[[ncmpcpp]]|Almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine)|http://ncmpcpp.rybczak.net/|{{Pkg|ncmpcpp}}}}<br />
*{{App|pms|Highly configurable and accessible ncurses client|http://pms.sourceforge.net/|{{AUR|pmus}}}}<br />
*{{App|vimpc|Ncurses based MPD client with vi-like key bindings|http://sourceforge.net/projects/vimpc/|{{AUR|vimpc}}}}<br />
<br />
=== Graphical ===<br />
<br />
*{{App|Ario|Very feature-rich GTK2 GUI client for mpd, inspired by Rhythmbox|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
*{{App|QmpdClient|GUI client written with Qt 4.x|http://bitcheese.net/wiki/QMPDClient|{{Pkg|qmpdclient}}}}<br />
*{{App|Sonata|Elegant Python GTK+ client|http://www.nongnu.org/sonata/|{{Pkg|sonata}}}}<br />
*{{App|gmpc|GTK2 frontend for Music Player Daemon. It is designed to be lightweight and easy to use, while providing full access to all of MPD's features. Users are presented with several different methods to browse through their music. It can be extended by plugins, of which many are available.|http://gmpclient.org/|{{Pkg|gmpc}}}}<br />
*{{App|Cantata|High-feature, Qt4, Qt5 or KDE4 client for MPD with very configurable interface|https://code.google.com/p/cantata/|{{Pkg|cantata}}}}<br />
<br />
=== Web ===<br />
<br />
*{{App|Patchfork|Web client for MPD written in PHP and Ajax|http://mpd.wikia.com/wiki/Client:Pitchfork|{{AUR|patchfork-git}}}}.<br />
<br />
== See also ==<br />
<br />
* [http://forum.musicpd.org/ MPD Forum]<br />
* [http://www.musicpd.org/doc/user/ MPD User Manual]<br />
* [[Wikipedia:Music Player Daemon|Wikipedia article]]</div>Overandhttps://wiki.archlinux.org/index.php?title=Citrix&diff=352238Citrix2014-12-24T01:16:31Z<p>Overand: Only three tries for a simple find-replace edit - not so bad, hm?</p>
<hr />
<div>[[Category:Virtualization]]<br />
{{stub|Missing overview/explanation at top}}<br />
== Install from AUR ==<br />
{{Out of date|Citrix provides an automatic installer, see manual installation}}<br />
====Install Package====<br />
{{AUR|citrix-client}} x86 and x86_64 (multilib)<br />
<br />
{{AUR|icaclient}} x86_64<br />
<br />
SSL connections are supported by default in both of these packages.<br />
<br />
====Update make dependencies for package lib32-libxaw (x86_64 only)====<br />
When installing the lib32-xaw dependency, a conflict will be signalled for the packages gcc, gcc-libs, and binutils.<br />
<br />
Replace these packages with their multilib versions, but do not forget to reinstall them after icaclient has been succesfully installed<br />
<br />
====Set Firefox to use Citrix====<br />
Then set Firefox to use one the following programs to open .ICA files, depending on your architecture.<br />
<br />
x86:<br />
<pre>/usr/bin/citrix-client.sh</pre><br />
x86_64:<br />
<pre>/opt/Citrix/ICAClient/wfica</pre><br />
<br />
====Google Chromium====<br />
If you have problems launching Citrix applications with Chromium, just go to {{ic|about:plugins}} and disable "Citrix Receiver for Linux".<br />
<br />
Next, create {{ic|/usr/share/applications/wfica.desktop}} (Exec path may vary based on package installed):<br />
<pre><br />
[Desktop Entry]<br />
Name=Citrix ICA client<br />
Comment="Launch Citrix applications from .ica files"<br />
Categories=Network;<br />
Exec=/usr/bin/wfica<br />
Terminal=false<br />
Type=Application<br />
NoDisplay=true<br />
MimeType=application/x-ica;</pre><br />
<br />
Now {{ic|xdg-open}} will handle .ica extensions using {{ic|/usr/bin/wfica}}.<br />
<br />
Note: if you are running Xfce and Chromium is opening the .ica files in the wrong application (e.g. a text editor), make sure you have {{ic|xorg-xprop}} installed.<br />
<br />
== Manual Install ==<br />
====Citrix Receiver (icaclient) Installation====<br />
* '''Step 0. 64-bit Arch systems only - install 32-bit libs:'''<br />
from Arch repositories: openmotif, lib32-libxmu, printproto, nspluginwrapper, lib32-alsa-lib, lib32-gcc-libs, lib32-libxft, lib32-gtk2, lib32-libxdamage, lib32-libpng12. <br />
From AUR: lib32-libxp, lib32-libxpm, lib32-libxaw, lib32-openmotif<br />
<br />
* '''Step 1.''' Download Citrix Receiver It can be found [http://www.citrix.com/downloads/citrix-receiver/linux.html here]. Choose the latest version of the x86 client in the .tar.gz format.<br />
<br />
* '''Step 2.''' Unpack the archive:<br />
<br />
<pre><br />
# tar zxvf en.linuxx86.tar.gz<br />
./<br />
./PkgId<br />
./install.txt<br />
./eula.txt<br />
./readme.txt<br />
./setupwfc<br />
./linuxx86/<br />
./linuxx86/hinst<br />
./linuxx86/linuxx86.cor/<br />
./linuxx86/linuxx86.cor/nls/<br />
./linuxx86/linuxx86.cor/nls/en/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfica<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfcmgr<br />
... many more files ...<br />
</pre><br />
<br />
* '''Step 3.''' Run setupwfc: <pre># ./setupwfc</pre> (Follow all instructions prompted by setupwfc.)<br />
* '''Step 4.''' (Applies only for Firefox integration:)<br />
<br />
The setup program should have made appropriate links to the "Citrix Receiver for Linux" plugin.<br />
You can check this as such:<br />
<pre><br />
# find / -name npica.so<br />
/opt/Citrix/ICAClient/npica.so<br />
</pre><br />
Or you can check if your browser loads the plugin, in Firefox this can be done by typing "about:plugins" in the address bar. If you have a 64-bit version of Firefox, the plugin will not be loaded. You can check below what to do.<br />
<br />
Create missing links as such:<br />
<pre># ln -s /opt/Citrix/ICAClient/npica.so /usr/lib/mozilla/plugins/</pre><br />
<br />
* '''Step 6.''' Restart your browser<br />
<br />
At this point, everything should work, including wfcmgr. In the case of Opera, integration should be automatic. The ICAClient will automatically be launched whenever you try to access a citrix-based application from either Firefox or Opera.<br />
<br />
'''Note:''' If for some reason firefox prompts you for which application to use when opening a citrix-based application, use <code>/opt/Citrix/ICAClient/wfica</code><br />
<br />
====Security Certificates====<br />
Because ICAClient uses SSL you may need a security certificate to connect to the server, check with the server administrator. If there is a certificate download and place it in {{ic|/usr/lib/ICAClient/keystore/cacerts/}}.<br />
<br />
You may then receive the error {{ic|You have not chosen to trust the issuer of the server's security certificate. (SSL Error 61)}}.<br />
<br />
There may be several reasons for this:<br />
<br />
; You do not have the root Certificate Authority (CA) certificates.<br />
: These are already installed on most systems, they are part of the core package {{Pkg|ca-certificates}}, but they are not where ICAClient looks for them. Copy the certificates from {{ic|/etc/ssl/certs/}} to {{ic|/usr/lib/ICAClient/keystore/cacerts/}}. As root, run the following command:<br />
: {{bc|# ln -sf /etc/ssl/certs/* /opt/Citrix/ICAClient/keystore/cacerts/}}<br />
: You may also need to download your CA's intermediate certificates and store them in the same directory.<br />
; Your server is using a certificate with a SHA-2 hash for the Signature Algorithm.<br />
: Microsoft has mandated that any certificates with an expiry date of 2017 or later must use a SHA-2 hash[http://www.p2vme.com/2014/02/sha2-certificates-and-citrix-receiver.html]. You may either:<br />
# Upgrade your client to 13.1 or later. Citrix now supports SHA-2 hashes in the ICA client version 13.1.0.285639.<br />
# Contact your CA and have your certificate re-keyed with a SHA-1 hash.</div>Overandhttps://wiki.archlinux.org/index.php?title=Citrix&diff=352237Citrix2014-12-24T01:15:43Z<p>Overand: Uh. Forgot to put /etc/ somehow...</p>
<hr />
<div>[[Category:Virtualization]]<br />
{{stub|Missing overview/explanation at top}}<br />
== Install from AUR ==<br />
{{Out of date|Citrix provides an automatic installer, see manual installation}}<br />
====Install Package====<br />
{{AUR|citrix-client}} x86 and x86_64 (multilib)<br />
<br />
{{AUR|icaclient}} x86_64<br />
<br />
SSL connections are supported by default in both of these packages.<br />
<br />
====Update make dependencies for package lib32-libxaw (x86_64 only)====<br />
When installing the lib32-xaw dependency, a conflict will be signalled for the packages gcc, gcc-libs, and binutils.<br />
<br />
Replace these packages with their multilib versions, but do not forget to reinstall them after icaclient has been succesfully installed<br />
<br />
====Set Firefox to use Citrix====<br />
Then set Firefox to use one the following programs to open .ICA files, depending on your architecture.<br />
<br />
x86:<br />
<pre>/usr/bin/citrix-client.sh</pre><br />
x86_64:<br />
<pre>/opt/Citrix/ICAClient/wfica</pre><br />
<br />
====Google Chromium====<br />
If you have problems launching Citrix applications with Chromium, just go to {{ic|about:plugins}} and disable "Citrix Receiver for Linux".<br />
<br />
Next, create {{ic|/usr/share/applications/wfica.desktop}} (Exec path may vary based on package installed):<br />
<pre><br />
[Desktop Entry]<br />
Name=Citrix ICA client<br />
Comment="Launch Citrix applications from .ica files"<br />
Categories=Network;<br />
Exec=/usr/bin/wfica<br />
Terminal=false<br />
Type=Application<br />
NoDisplay=true<br />
MimeType=application/x-ica;</pre><br />
<br />
Now {{ic|xdg-open}} will handle .ica extensions using {{ic|/usr/bin/wfica}}.<br />
<br />
Note: if you are running Xfce and Chromium is opening the .ica files in the wrong application (e.g. a text editor), make sure you have {{ic|xorg-xprop}} installed.<br />
<br />
== Manual Install ==<br />
====Citrix Receiver (icaclient) Installation====<br />
* '''Step 0. 64-bit Arch systems only - install 32-bit libs:'''<br />
from Arch repositories: openmotif, lib32-libxmu, printproto, nspluginwrapper, lib32-alsa-lib, lib32-gcc-libs, lib32-libxft, lib32-gtk2, lib32-libxdamage, lib32-libpng12. <br />
From AUR: lib32-libxp, lib32-libxpm, lib32-libxaw, lib32-openmotif<br />
<br />
* '''Step 1.''' Download Citrix Receiver It can be found [http://www.citrix.com/downloads/citrix-receiver/linux.html here]. Choose the latest version of the x86 client in the .tar.gz format.<br />
<br />
* '''Step 2.''' Unpack the archive:<br />
<br />
<pre><br />
# tar zxvf en.linuxx86.tar.gz<br />
./<br />
./PkgId<br />
./install.txt<br />
./eula.txt<br />
./readme.txt<br />
./setupwfc<br />
./linuxx86/<br />
./linuxx86/hinst<br />
./linuxx86/linuxx86.cor/<br />
./linuxx86/linuxx86.cor/nls/<br />
./linuxx86/linuxx86.cor/nls/en/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfica<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfcmgr<br />
... many more files ...<br />
</pre><br />
<br />
* '''Step 3.''' Run setupwfc: <pre># ./setupwfc</pre> (Follow all instructions prompted by setupwfc.)<br />
* '''Step 4.''' (Applies only for Firefox integration:)<br />
<br />
The setup program should have made appropriate links to the "Citrix Receiver for Linux" plugin.<br />
You can check this as such:<br />
<pre><br />
# find / -name npica.so<br />
/opt/Citrix/ICAClient/npica.so<br />
</pre><br />
Or you can check if your browser loads the plugin, in Firefox this can be done by typing "about:plugins" in the address bar. If you have a 64-bit version of Firefox, the plugin will not be loaded. You can check below what to do.<br />
<br />
Create missing links as such:<br />
<pre># ln -s /opt/Citrix/ICAClient/npica.so /usr/lib/mozilla/plugins/</pre><br />
<br />
* '''Step 6.''' Restart your browser<br />
<br />
At this point, everything should work, including wfcmgr. In the case of Opera, integration should be automatic. The ICAClient will automatically be launched whenever you try to access a citrix-based application from either Firefox or Opera.<br />
<br />
'''Note:''' If for some reason firefox prompts you for which application to use when opening a citrix-based application, use <code>/opt/Citrix/ICAClient/wfica</code><br />
<br />
====Security Certificates====<br />
Because ICAClient uses SSL you may need a security certificate to connect to the server, check with the server administrator. If there is a certificate download and place it in {{ic|/usr/lib/ICAClient/keystore/cacerts/}}.<br />
<br />
You may then receive the error {{ic|You have not chosen to trust the issuer of the server's security certificate. (SSL Error 61)}}.<br />
<br />
There may be several reasons for this:<br />
<br />
; You do not have the root Certificate Authority (CA) certificates.<br />
: These are already installed on most systems, they are part of the core package {{Pkg|ca-certificates}}, but they are not where ICAClient looks for them. Copy the certificates from {{ic|/usr/share/ca-certificates/mozilla/}} to {{ic|/usr/lib/ICAClient/keystore/cacerts/}}. As root, run the following command:<br />
: {{bc|# ln -sf /etc/ssl/certs/* /opt/Citrix/ICAClient/keystore/cacerts/}}<br />
: You may also need to download your CA's intermediate certificates and store them in the same directory.<br />
; Your server is using a certificate with a SHA-2 hash for the Signature Algorithm.<br />
: Microsoft has mandated that any certificates with an expiry date of 2017 or later must use a SHA-2 hash[http://www.p2vme.com/2014/02/sha2-certificates-and-citrix-receiver.html]. You may either:<br />
# Upgrade your client to 13.1 or later. Citrix now supports SHA-2 hashes in the ICA client version 13.1.0.285639.<br />
# Contact your CA and have your certificate re-keyed with a SHA-1 hash.</div>Overandhttps://wiki.archlinux.org/index.php?title=Citrix&diff=352236Citrix2014-12-24T01:14:49Z<p>Overand: /* Manual Install */ Recent cert location changes</p>
<hr />
<div>[[Category:Virtualization]]<br />
{{stub|Missing overview/explanation at top}}<br />
== Install from AUR ==<br />
{{Out of date|Citrix provides an automatic installer, see manual installation}}<br />
====Install Package====<br />
{{AUR|citrix-client}} x86 and x86_64 (multilib)<br />
<br />
{{AUR|icaclient}} x86_64<br />
<br />
SSL connections are supported by default in both of these packages.<br />
<br />
====Update make dependencies for package lib32-libxaw (x86_64 only)====<br />
When installing the lib32-xaw dependency, a conflict will be signalled for the packages gcc, gcc-libs, and binutils.<br />
<br />
Replace these packages with their multilib versions, but do not forget to reinstall them after icaclient has been succesfully installed<br />
<br />
====Set Firefox to use Citrix====<br />
Then set Firefox to use one the following programs to open .ICA files, depending on your architecture.<br />
<br />
x86:<br />
<pre>/usr/bin/citrix-client.sh</pre><br />
x86_64:<br />
<pre>/opt/Citrix/ICAClient/wfica</pre><br />
<br />
====Google Chromium====<br />
If you have problems launching Citrix applications with Chromium, just go to {{ic|about:plugins}} and disable "Citrix Receiver for Linux".<br />
<br />
Next, create {{ic|/usr/share/applications/wfica.desktop}} (Exec path may vary based on package installed):<br />
<pre><br />
[Desktop Entry]<br />
Name=Citrix ICA client<br />
Comment="Launch Citrix applications from .ica files"<br />
Categories=Network;<br />
Exec=/usr/bin/wfica<br />
Terminal=false<br />
Type=Application<br />
NoDisplay=true<br />
MimeType=application/x-ica;</pre><br />
<br />
Now {{ic|xdg-open}} will handle .ica extensions using {{ic|/usr/bin/wfica}}.<br />
<br />
Note: if you are running Xfce and Chromium is opening the .ica files in the wrong application (e.g. a text editor), make sure you have {{ic|xorg-xprop}} installed.<br />
<br />
== Manual Install ==<br />
====Citrix Receiver (icaclient) Installation====<br />
* '''Step 0. 64-bit Arch systems only - install 32-bit libs:'''<br />
from Arch repositories: openmotif, lib32-libxmu, printproto, nspluginwrapper, lib32-alsa-lib, lib32-gcc-libs, lib32-libxft, lib32-gtk2, lib32-libxdamage, lib32-libpng12. <br />
From AUR: lib32-libxp, lib32-libxpm, lib32-libxaw, lib32-openmotif<br />
<br />
* '''Step 1.''' Download Citrix Receiver It can be found [http://www.citrix.com/downloads/citrix-receiver/linux.html here]. Choose the latest version of the x86 client in the .tar.gz format.<br />
<br />
* '''Step 2.''' Unpack the archive:<br />
<br />
<pre><br />
# tar zxvf en.linuxx86.tar.gz<br />
./<br />
./PkgId<br />
./install.txt<br />
./eula.txt<br />
./readme.txt<br />
./setupwfc<br />
./linuxx86/<br />
./linuxx86/hinst<br />
./linuxx86/linuxx86.cor/<br />
./linuxx86/linuxx86.cor/nls/<br />
./linuxx86/linuxx86.cor/nls/en/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfica<br />
./linuxx86/linuxx86.cor/nls/en/UTF-8/Wfcmgr<br />
... many more files ...<br />
</pre><br />
<br />
* '''Step 3.''' Run setupwfc: <pre># ./setupwfc</pre> (Follow all instructions prompted by setupwfc.)<br />
* '''Step 4.''' (Applies only for Firefox integration:)<br />
<br />
The setup program should have made appropriate links to the "Citrix Receiver for Linux" plugin.<br />
You can check this as such:<br />
<pre><br />
# find / -name npica.so<br />
/opt/Citrix/ICAClient/npica.so<br />
</pre><br />
Or you can check if your browser loads the plugin, in Firefox this can be done by typing "about:plugins" in the address bar. If you have a 64-bit version of Firefox, the plugin will not be loaded. You can check below what to do.<br />
<br />
Create missing links as such:<br />
<pre># ln -s /opt/Citrix/ICAClient/npica.so /usr/lib/mozilla/plugins/</pre><br />
<br />
* '''Step 6.''' Restart your browser<br />
<br />
At this point, everything should work, including wfcmgr. In the case of Opera, integration should be automatic. The ICAClient will automatically be launched whenever you try to access a citrix-based application from either Firefox or Opera.<br />
<br />
'''Note:''' If for some reason firefox prompts you for which application to use when opening a citrix-based application, use <code>/opt/Citrix/ICAClient/wfica</code><br />
<br />
====Security Certificates====<br />
Because ICAClient uses SSL you may need a security certificate to connect to the server, check with the server administrator. If there is a certificate download and place it in {{ic|/usr/lib/ICAClient/keystore/cacerts/}}.<br />
<br />
You may then receive the error {{ic|You have not chosen to trust the issuer of the server's security certificate. (SSL Error 61)}}.<br />
<br />
There may be several reasons for this:<br />
<br />
; You do not have the root Certificate Authority (CA) certificates.<br />
: These are already installed on most systems, they are part of the core package {{Pkg|ca-certificates}}, but they are not where ICAClient looks for them. Copy the certificates from {{ic|/usr/share/ca-certificates/mozilla/}} to {{ic|/usr/lib/ICAClient/keystore/cacerts/}}. As root, run the following command:<br />
: {{bc|# ln -sf /ssl/certs/* /opt/Citrix/ICAClient/keystore/cacerts/}}<br />
: You may also need to download your CA's intermediate certificates and store them in the same directory.<br />
; Your server is using a certificate with a SHA-2 hash for the Signature Algorithm.<br />
: Microsoft has mandated that any certificates with an expiry date of 2017 or later must use a SHA-2 hash[http://www.p2vme.com/2014/02/sha2-certificates-and-citrix-receiver.html]. You may either:<br />
# Upgrade your client to 13.1 or later. Citrix now supports SHA-2 hashes in the ICA client version 13.1.0.285639.<br />
# Contact your CA and have your certificate re-keyed with a SHA-1 hash.</div>Overandhttps://wiki.archlinux.org/index.php?title=Improving_performance&diff=341234Improving performance2014-10-22T20:42:14Z<p>Overand: /* RAM disks / tuning for really slow disks */</p>
<hr />
<div>[[Category:Hardware]]<br />
[[Category:System administration]]<br />
[[ar:Maximizing Performance]]<br />
[[es:Maximizing Performance]]<br />
[[ja:Maximizing Performance]]<br />
[[ru:Maximizing Performance]]<br />
[[zh-CN:Maximizing Performance]]<br />
This article provides information on basic system diagnostics relating to performance as well as steps that may be taken to reduce resource consumption or to otherwise optimize the system with the end-goal being either perceived or documented improvements to a system's performance.<br />
<br />
==The basics==<br />
<br />
===Know your system===<br />
<br />
The best way to tune a system is to target the bottlenecks, that is the subsystems that limit the overall speed. They usually can be identified by knowing the specifications of the system, but there are some basic indications:<br />
<br />
* If the computer becomes slow when big applications, like OpenOffice.org and Firefox, are running at the same time, then there is a good chance the amount of RAM is insufficient. To verify available RAM, use this command, and check for the line beginning with -/+buffers:<br />
<br />
$ free -m<br />
<br />
* If boot time is really slow, and if applications take a lot of time to load the first time they are launched, but run fine afterwards, then the hard drive is probably too slow. The speed of a hard drive can be measured using the {{ic|hdparm}} command:<br />
<br />
# hdparm -t /dev/sdx<br />
<br />
This is only the pure read speed of the hard drive, and is not a valid benchmark, but a value superior to 40MB/s (assuming drive tested while idle) can be considered decent on an average system. hdparm can be found in the [[Official repositories]].<br />
* If the CPU load is consistently high even when RAM is available, then lowering CPU usage should be a priority. CPU load can be monitored in many ways, like using the {{ic|top}} command:<br />
<br />
$ top<br />
<br />
* If the only applications lagging are the ones using direct rendering, meaning they use the graphic card, like video players and games, then improving the graphic performance should help. First step would be to verify if direct rendering simply is not enabled. This is indicated by the {{ic|glxinfo}} command:<br />
<br />
$ glxinfo | grep direct<br />
<br />
{{ic|glxinfo}} is part of {{Pkg|mesa-demos}} package.<br />
<br />
===The first thing to do===<br />
<br />
The simplest and most efficient way of improving overall performance is to run lightweight environments and applications.<br />
* Use a [[window manager]] instead of a [[desktop environment]]. Choices include [[Awesome]], [[dwm]], [[Fluxbox]], [[i3]], [[JWM]], [[Openbox]], [[wmii]] and [[xmonad]].<br />
* Choose a lightweight desktop environment, such as [[LXDE]] or [[Xfce]], over a heavier one like [[GNOME]] or [[KDE]].<br />
* Use lightweight applications. Search [[List of applications]] for console applications and read the Light and Fast Applications Awards threads in the forum: [https://bbs.archlinux.org/viewtopic.php?id=41168 2007], [https://bbs.archlinux.org/viewtopic.php?id=67951 2008], [https://bbs.archlinux.org/viewtopic.php?id=78490 2009], [https://bbs.archlinux.org/viewtopic.php?id=88515 2010], [https://bbs.archlinux.org/viewtopic.php?id=111878 2011], and [https://bbs.archlinux.org/viewtopic.php?id=138281 2012].<br />
* Remove unnecessary [[daemons]].<br />
<br />
=== Compromise ===<br />
<br />
Almost all tuning brings drawbacks. Lighter applications usually come with less features and some tweaks may make a system unstable, or simply require time to implement and maintain. This page tries to highlight those drawbacks, but the final judgment rests on the user.<br />
<br />
=== Benchmarking ===<br />
<br />
The effects of optimization are often difficult to judge. They can however be measured by [[benchmarking]] tools.<br />
<br />
== Storage devices ==<br />
<br />
=== Device layout ===<br />
<br />
One of the biggest performance gains comes from having multiple storage devices in a layout that spreads the operating system work around. Having {{ic|/}} {{ic|/home}} {{ic|/var}} and {{ic|/usr}} on separate disks is dramatically faster than a single disk layout where they are all on the same hard drive.<br />
<br />
==== Swap files ====<br />
<br />
Creating your swap files on a separate disk can also help quite a bit, especially if your machine swaps frequently. It happens if you do not have enough RAM for your environment. Using KDE with all the features and applications that come along may require several GiB of memory, whereas a tiny window manager with console applications will perfectly fit in less than 512 MiB of memory.<br />
<br />
==== RAID benefits ====<br />
<br />
If you have multiple disks available, you can set them up as a software [[RAID]] for serious speed improvements. In a RAID 0 array there is no redundancy in case of drive failure, but for each additional disk you add to the array, the speed of the disk becomes that much faster.<br />
<br />
==== Multiple hardware paths ====<br />
<br />
An internal hardware path is how the storage device is connected to your motherboard. There are different ways to connect to the motherboard such as TCP/IP through a NIC, plugged in directly using PCIe/PCI, Firewire, Raid Card, USB, etc. By spreading your storage devices across these multiple connection points you maximize the capabilities of your motherboard, for example 6 hard-drives connected via USB would be much much slower than 3 over USB and 3 over Firewire. The reason is that each entry path into the motherboard is like a pipe, and there is a set limit to how much can go through that pipe at any one time. The good news is that the motherboard usually has several pipes.<br />
<br />
More Examples<br />
# Directly to the motherboard using pci/PCIe/ata<br />
# Using an external enclosure to house the disk over USB/Firewire<br />
# Turn the device into a network storage device by connecting over tcp/ip<br />
<br />
Note also that if you have a 2 USB ports on the front of your machine, and 4 USB ports on the back, and you have 4 disks, it would probably be fastest to put 2 on front/2 on back or 3 on back/1 on front. This is because internally the front ports are likely a separate Root Hub than the back, meaning you can send twice as much data by using both than just 1. Use the following commands to determine the various paths on your machine.<br />
<br />
{{hc|USB Device Tree|$ lsusb -tv}}<br />
<br />
{{hc|PCI Device Tree|$ lspci -tv}}<br />
<br />
=== Partitioning ===<br />
<br />
If using a traditional spinning HDD, your partition layout can influence the system's performance. Sectors at the beginning of the drive (closer to the outside of the disk) are faster than those at the end. Also, a smaller partition requires less movements from the drive's head, and so speed up disk operations. Therefore, it is advised to create a small partition (10GB, more or less depending on your needs) only for your system, as near to the beginning of the drive as possible. Other data (pictures, videos) should be kept on a separate partition, and this is usually achieved by separating the home directory ({{ic|/home/''user''}}) from the system ({{ic|/}}).<br />
<br />
=== Choosing and tuning your filesystem ===<br />
<br />
Choosing the best filesystem for a specific system is very important because each has its own strengths. The [[File systems]] article provides a short summary of the most popular ones. You can also find relevant articles [[:Category:File systems|here]].<br />
<br />
==== Mount options ====<br />
<br />
The [[fstab#Field definitions|mount options]] {{ic|noatime}} and {{ic|nodiratime}} are known to improve performance on almost all file systems. {{ic|noatime}} is a superset of {{ic|nodiratime}}, as {{ic|nodiratime}} applies to directories only, whereas {{ic|noatime}} applies to both files and directories. In rare cases, for example if you use [[mutt]], these options can cause minor problems. You can use the {{ic|relatime}} option instead, which is a default option.<br />
<br />
Other mount options are filesystem specific, therefore see the relevant articles for the filesystems:<br />
<br />
* [[Ext3]]<br />
* [[Ext4]]: [[Ext4#Tips and tricks|Tips and tricks]]<br />
* [[JFS Filesystem|JFS]]: [[JFS Filesystem#Optimizations|Optimizations]]<br />
* [[XFS]]<br />
* [[Btrfs]]: [[Btrfs#Defragmentation|Defragmentation]] and [[Btrfs#Compression|Compression]]<br />
<br />
===== Reiserfs =====<br />
<br />
The {{Ic|1=data=writeback}} mount option improves speed, but may corrupt data during power loss. The {{Ic|notail}} mount option increases the space used by the filesystem by about 5%, but also improves overall speed. You can also reduce disk load by putting the journal and data on separate drives. This is done when creating the filesystem: <br />
<br />
# mkreiserfs –j /dev/sd'''a1''' /dev/sd'''b1'''<br />
<br />
Replace {{ic|/dev/sd'''a1'''}} with the partition reserved for the journal, and {{ic|/dev/sd'''b1'''}} with the partition for data. You can learn more about reiserfs with this [http://www.funtoo.org/Funtoo_Filesystem_Guide,_Part_2 article].<br />
<br />
=== Tuning kernel parameters ===<br />
<br />
There are several key tunables affecting the performance of block devices, see [[sysctl#Virtual memory]] for more information.<br />
<br />
=== Compressing /usr ===<br />
<br />
{{Note|As of version 3.0 of the Linux kernel, aufs2 is no longer supported.}}<br />
{{out of date|aufs is no longer in the official repos. Also, read the Note box above.}}<br />
A way to speed up reading from the hard drive is to compress the data, because there is less data to be read. It must however be decompressed, which means a greater CPU load. Some file systems support transparent compression, most notably Btrfs and reiserfs4, but their compression ratio is limited by the 4k block size. A good alternative is to compress {{ic|/usr}} in a squashfs file, with a 64k(128k) block size, as instructed in this [http://forums.gentoo.org/viewtopic-t-646289.html Gentoo forums thread]. What this tutorial does is basically to compress the {{ic|/usr}} folder into a compressed squashfs file-system, then mounts it with aufs. A lot of space is saved, usually two thirds of the original size of {{ic|/usr}}, and applications load faster. However, each time an application is installed or reinstalled, it is written uncompressed, so {{ic|/usr}} must be re-compressed periodically. Squashfs is already in the kernel, and aufs2 is in the official repositories, so no kernel compilation is needed if using the stock kernel.<br />
Since the linked guide is for Gentoo, the next commands outline the steps specifically for Arch. To get it working, [[pacman|install]] the packages aufs2 and {{pkg|squashfs-tools}}. These packages provide the aufs-modules and some userspace-tools for the squash-filesystem.<br />
<br />
Now we need some extra directories where we can store the archive of {{ic|/usr}} as read-only and another folder where we can store the data changed after the last compression as writeable:<br />
# mkdir -p /squashed/usr/{ro,rw}<br />
Now that we got a rough setup you should perform a complete system-upgrade since every change of content in {{ic|/usr}} after the compression will be excluded from this speedup. If you use prelink you should also perform a complete prelink before creating the archive. Now it is time to invoke the command to compress {{ic|/usr}}:<br />
# mksquashfs /usr /squashed/usr/usr.sfs -b 65536<br />
These parameters/options are the ones suggested by the Gentoo link but there might be some room for improvement using some of the options described [http://www.tldp.org/HOWTO/SquashFS-HOWTO/mksqoverview.html#mksqusing here].<br />
Now to get the archive mounted together with the writeable folder it is necessary to edit {{ic|/etc/fstab}} and add the following lines:<br />
/squashed/usr/usr.sfs /squashed/usr/ro squashfs loop,ro 0 0 <br />
usr /usr aufs udba=reval,br:/squashed/usr/rw:/squashed/usr/ro 0 0<br />
Now you should be done and able to reboot. The original author suggests to delete all the old content of {{ic|/usr}}, but this might cause some problems if anything goes wrong during some later re-compression. It is safer to leave the old files in place.<br />
<br />
A [https://bbs.archlinux.org/viewtopic.php?pid=714052 Bash script] has been created that will automate the process of re-compressing (read updating) the archive since the tutorial is meant for Gentoo and some options do not correlate to what they should be in Arch.<br />
<br />
=== Tuning for an SSD ===<br />
<br />
[[SSD#Tips_for_Maximizing_SSD_Performance]]<br />
<br />
=== RAM disks / tuning for really slow disks ===<br />
<br />
* [http://cs.joensuu.fi/~mmeri/usbraid/ USB stick RAID] - REALLY old article, uses deprecated or otherwise obsolete tools & techniques. (Also, largely intended as humorous)<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=493773#p493773 Combine RAM disk with disk in RAID]<br />
<br />
=== USB storage devices ===<br />
<br />
{{Expansion|provide better description, or at least some reference}}<br />
{{Accuracy|How should using KDE affect the copy speed?}}<br />
<br />
If you experienced slow copy speed to pendrive (mainly in KDE), then append these three lines in a [[systemd]] tmpfile:<br />
<br />
{{hc|/etc/tmpfiles.d/local.conf|<br />
w /sys/kernel/mm/transparent_hugepage/enabled - - - - madvise<br />
w /sys/kernel/mm/transparent_hugepage/defrag - - - - madvise<br />
w /sys/kernel/mm/transparent_hugepage/khugepaged/defrag - - - - 0<br />
}}<br />
<br />
See also [[sysctl#Virtual memory]].<br />
<br />
== CPU ==<br />
<br />
The only way to directly improve CPU speed is overclocking. As it is a complicated and risky task, it is not recommended for anyone except experts. The best way to overclock is through the BIOS. When purchasing your system, keep in mind that most Intel motherboards are notorious for disabling the capability to overclock.<br />
<br />
Many Intel i5 and i7 chips, even when overclocked properly through the BIOS or UEFI interface, will not report the correct clock frequency to acpi_cpufreq and most other utilities. This will result in excessive messages in dmesg about delays unless the module acpi_cpufreq is unloaded and blacklisted. The only tool known to correctly read the clock speed of these overclocked chips under Linux is i7z. The {{Pkg|i7z}} package is available in the community repo and {{AUR|i7z-git}} is available in the [[AUR]].<br />
<br />
A way to modify performance ([http://lkml.org/lkml/2009/9/6/136 ref]) is to use Con Kolivas' desktop-centric kernel patchset, which, among other things, replaces the Completely Fair Scheduler (CFS) with the Brain Fuck Scheduler (BFS).<br />
<br />
Kernel PKGBUILDs that include the BFS patch can be installed from the [[AUR]] or [[Unofficial user repositories]]. See the respective pages for {{AUR|linux-ck}} and [[Linux-ck]] wiki page, {{AUR|linux-pf}} [[Linux-pf]] wiki page or {{AUR|linux-bfs}} for more information on their additional patches.<br />
<br />
{{Note|BFS/CK are designed for desktop/laptop use and not servers. They provide low latency and work well for 16 CPUs or less. Also, Con Kolivas suggests setting HZ to 1000. For more information, see the [http://ck.kolivas.org/patches/bfs/bfs-faq.txt BFS FAQ] and [http://users.on.net/~ckolivas/kernel/ Kernel patch homepage of Con Kolivas].}}<br />
<br />
=== Verynice ===<br />
<br />
[[VeryNice]] is a daemon, available in the [[AUR]] as {{AUR|verynice}}, for dynamically adjusting the nice levels of executables. The nice level represents the priority of the executable when allocating CPU resources. Simply define executables for which responsiveness is important, like X or multimedia applications, as ''goodexe'' in {{ic|/etc/verynice.conf}}. Similarly, CPU-hungry executables running in the background, like make, can be defined as ''badexe''. This prioritization greatly improves system responsiveness under heavy load.<br />
<br />
=== Ulatencyd ===<br />
<br />
[[Ulatencyd]] is a daemon that controls how the Linux kernel will spend its resources on the running processes. It uses dynamic cgroups to give the kernel hints and limitations on processes. It supports prioritizing processes for disk I/O as well as CPU shares, and uses more clever heuristics than Verynice. In addition, it comes with a good set of configs out of the box.<br />
<br />
One note of warning, by default it changes the default scheduler of all block devices to cfq, to disable behavior see [[Ulatencyd]].<br />
<br />
=== irqbalance ===<br />
<br />
The purpose of {{Pkg|irqbalance}} is distribute hardware interrupts across processors on a multiprocessor system in order to increase performance. It can be [[systemd#Using units|controlled]] by the provided {{ic|irqbalance.service}}.<br />
<br />
== Graphics ==<br />
<br />
=== Xorg.conf configuration ===<br />
<br />
Graphic performance heavily depends on the settings in {{ic|/etc/X11/xorg.conf}}. There are tutorials for [[NVIDIA]], [[ATI]] and [[Intel]] cards. Improper settings may stop Xorg from working, so caution is advised.<br />
<br />
=== Driconf ===<br />
<br />
{{Pkg|driconf}} is a small utility that can be found in the [[official repositories]] that allows you to change the direct rendering settings for open source drivers. Enabling HyperZ can drastically improve performance.<br />
<br />
=== GPU overclocking ===<br />
{{Out of date|GMABooster is for older intel chips.}}<br />
Overclocking a graphics card is typically more expedient than with a CPU, since there are readily accessible software packages which allow for on-the-fly GPU clock adjustments. For ATI users, get {{AUR|rovclock}} or {{AUR|amdoverdrivectrl}}, and NVIDIA users should get {{AUR|nvclock}} from the AUR. Intel chipsets users can install [http://www.gmabooster.com/ GMABooster] from with the {{AUR|gmabooster}} AUR package.<br />
<br />
The changes can be made permanent by running the appropriate command after X boots, for example by adding it to {{ic|~/.xinitrc}}. A safer approach would be to only apply the overclocked settings when needed.<br />
<br />
== RAM and swap ==<br />
<br />
=== Relocate files to tmpfs ===<br />
{{Out of date|/tmp configured using tmpfs is now considered the standard method and is included in the beginner's installation guide.}}<br />
Relocate files, such as your browser profile, to a [[Wikipedia:tmpfs|tmpfs]] file system, including {{ic|/tmp}}, or {{ic|/dev/shm}} for improvements in application response as all the files are now stored in RAM.<br />
<br />
Use an active management script for maximal reliability and ease of use. <br />
<br />
Refer to the [[Profile-sync-daemon]] wiki article for more information on syncing browser profiles.<br />
<br />
Refer to the [[Anything-sync-daemon]] wiki article for more information on syncing any specified folder.<br />
<br />
=== Swappiness ===<br />
<br />
See [[Swap#Swappiness]].<br />
<br />
=== Compcache/Zram ===<br />
<br />
[https://code.google.com/p/compcache/ Compcache], nowadays replaced by the '''zram''' kernel module, creates a device in RAM and compresses it. If you use for swap means that part of the RAM can hold much more information but uses more CPU. Still, it is much quicker than swapping to a hard drive. If a system often falls back to swap, this could improve responsiveness. Zram is considered stable as of kernel 3.14 ([http://kernelnewbies.org/Linux_3.14#head-72b295b09fea85de2e80f0b7850048264fed887e Kernel Newbies report]), so be careful if using an older kernel version.<br />
<br />
The AUR package {{AUR|zramswap}} provides an automated script for setting up such swap devices with optimal settings for your system (such as RAM size and CPU core number). The script creates one zram device per CPU core with a total space equivalent to the RAM available. To do this automatically on every boot, enable {{ic|zramswap.service}} via [[systemd#Basic systemctl usage|systemctl]]. <br />
<br />
You will have a compressed swap with higher priority than your regular swap which will utilize multiple CPU cores for compessing data.<br />
<br />
{{Tip|Using zram is also a good way to reduce disk read/write cycles due to swap on SSDs.}}<br />
<br />
=== Using the graphic card's RAM ===<br />
<br />
In the unlikely case that you have very little RAM and a surplus of video RAM, you can use the latter as swap. See [[Swap on video ram]].<br />
<br />
=== Preloading ===<br />
<br />
Preloading is the action of putting and keeping target files into the RAM. The benefit is that preloaded applications start more quickly because reading from the RAM is always quicker than from the hard drive. However, part of your RAM will be dedicated to this task, but no more than if you kept the application open. Therefore preloading is best used with large and often-used applications like Firefox and LibreOffice.<br />
<br />
==== Go-preload ====<br />
<br />
{{AUR|gopreload-git}} is a small daemon created in the [http://forums.gentoo.org/viewtopic-t-789818-view-next.html?sid=5457cff93039fc7d4a3e445ef90f9821 Gentoo forum]. To use it, first run this command in a terminal for each program you want to preload at boot:<br />
# gopreload-prepare program<br />
<br />
For regular users, take ownership of {{ic|/usr/share/gopreload/enabled}} and {{ic|/usr/share/gopreload/disabled}}<br />
# chown username:users /usr/share/gopreload/enabled /usr/share/gopreload/disabled<br />
and then gopreload each program you want to preload:<br />
$ gopreload-prepare program<br />
<br />
Then, as instructed, press Enter when the program is fully loaded. This will add a list of files needed by the program in {{ic|/usr/share/gopreload/enabled}}. To load all lists at boot, enable the systemd service file:<br />
# systemctl enable gopreload.service<br />
<br />
To disable the loading of a program, remove the appropriate list in {{ic|/usr/share/gopreload/enabled}} or move it to {{ic|/usr/share/gopreload/disabled}}.<br />
<br />
==== Preload ====<br />
<br />
A more automated approach is used by [[Preload]]. All you have to do is enable it with this command:<br />
# systemctl enable preload<br />
It will monitor the most used files on your system, and with time build its own list of files to preload at boot.<br />
<br />
== Boot time ==<br />
<br />
You can find tutorials with good tips in the article [[Improve boot performance]].<br />
<br />
=== Suspend to RAM ===<br />
<br />
The best way to reduce boot time is not booting at all. Consider [[Suspend and hibernate#Suspend to RAM|suspending your system to RAM]] instead.<br />
<br />
== Network ==<br />
<br />
Use a DNS caching server in your local network. Every time a connections is made, the TCP/IP stack must resolve a fully qualified donamin name to an IP address. Only then the connection can be done. To use a DNS caching server directly present in your local network will decreases the latency on new connections. Your DSL router should contain such server, if not you can install your own. See [[Dnsmasq]] for more details.<br />
<br />
== Application-specific tips ==<br />
<br />
=== Firefox ===<br />
<br />
See [[Firefox tweaks#Performance]] and [[Firefox Ramdisk]].<br />
<br />
Firefox in the official repositories is built with the profile guided optimization flag enabled. You may want to use it in your custom build.<br />
To do this append:<br />
ac_add_options --enable-profile-guided-optimization<br />
to your {{ic|.mozconfig}} file.<br />
<br />
=== Gcc/Makepkg ===<br />
<br />
See [[Ccache]].<br />
<br />
=== Office suites ===<br />
<br />
See [[LibreOffice#Speed up LibreOffice|Speed up LibreOffice]] and [[Openoffice#Speed up OpenOffice|Speed up OpenOffice]].<br />
<br />
=== Pacman ===<br />
<br />
See [[Improve pacman performance]].<br />
<br />
=== SSH ===<br />
<br />
See [[SSH#Speeding up SSH|Speed up SSH]].<br />
<br />
== Laptops ==<br />
<br />
See [[Laptop]].</div>Overandhttps://wiki.archlinux.org/index.php?title=Improving_performance&diff=341233Improving performance2014-10-22T20:41:54Z<p>Overand: /* RAM disks / tuning for really slow disks */</p>
<hr />
<div>[[Category:Hardware]]<br />
[[Category:System administration]]<br />
[[ar:Maximizing Performance]]<br />
[[es:Maximizing Performance]]<br />
[[ja:Maximizing Performance]]<br />
[[ru:Maximizing Performance]]<br />
[[zh-CN:Maximizing Performance]]<br />
This article provides information on basic system diagnostics relating to performance as well as steps that may be taken to reduce resource consumption or to otherwise optimize the system with the end-goal being either perceived or documented improvements to a system's performance.<br />
<br />
==The basics==<br />
<br />
===Know your system===<br />
<br />
The best way to tune a system is to target the bottlenecks, that is the subsystems that limit the overall speed. They usually can be identified by knowing the specifications of the system, but there are some basic indications:<br />
<br />
* If the computer becomes slow when big applications, like OpenOffice.org and Firefox, are running at the same time, then there is a good chance the amount of RAM is insufficient. To verify available RAM, use this command, and check for the line beginning with -/+buffers:<br />
<br />
$ free -m<br />
<br />
* If boot time is really slow, and if applications take a lot of time to load the first time they are launched, but run fine afterwards, then the hard drive is probably too slow. The speed of a hard drive can be measured using the {{ic|hdparm}} command:<br />
<br />
# hdparm -t /dev/sdx<br />
<br />
This is only the pure read speed of the hard drive, and is not a valid benchmark, but a value superior to 40MB/s (assuming drive tested while idle) can be considered decent on an average system. hdparm can be found in the [[Official repositories]].<br />
* If the CPU load is consistently high even when RAM is available, then lowering CPU usage should be a priority. CPU load can be monitored in many ways, like using the {{ic|top}} command:<br />
<br />
$ top<br />
<br />
* If the only applications lagging are the ones using direct rendering, meaning they use the graphic card, like video players and games, then improving the graphic performance should help. First step would be to verify if direct rendering simply is not enabled. This is indicated by the {{ic|glxinfo}} command:<br />
<br />
$ glxinfo | grep direct<br />
<br />
{{ic|glxinfo}} is part of {{Pkg|mesa-demos}} package.<br />
<br />
===The first thing to do===<br />
<br />
The simplest and most efficient way of improving overall performance is to run lightweight environments and applications.<br />
* Use a [[window manager]] instead of a [[desktop environment]]. Choices include [[Awesome]], [[dwm]], [[Fluxbox]], [[i3]], [[JWM]], [[Openbox]], [[wmii]] and [[xmonad]].<br />
* Choose a lightweight desktop environment, such as [[LXDE]] or [[Xfce]], over a heavier one like [[GNOME]] or [[KDE]].<br />
* Use lightweight applications. Search [[List of applications]] for console applications and read the Light and Fast Applications Awards threads in the forum: [https://bbs.archlinux.org/viewtopic.php?id=41168 2007], [https://bbs.archlinux.org/viewtopic.php?id=67951 2008], [https://bbs.archlinux.org/viewtopic.php?id=78490 2009], [https://bbs.archlinux.org/viewtopic.php?id=88515 2010], [https://bbs.archlinux.org/viewtopic.php?id=111878 2011], and [https://bbs.archlinux.org/viewtopic.php?id=138281 2012].<br />
* Remove unnecessary [[daemons]].<br />
<br />
=== Compromise ===<br />
<br />
Almost all tuning brings drawbacks. Lighter applications usually come with less features and some tweaks may make a system unstable, or simply require time to implement and maintain. This page tries to highlight those drawbacks, but the final judgment rests on the user.<br />
<br />
=== Benchmarking ===<br />
<br />
The effects of optimization are often difficult to judge. They can however be measured by [[benchmarking]] tools.<br />
<br />
== Storage devices ==<br />
<br />
=== Device layout ===<br />
<br />
One of the biggest performance gains comes from having multiple storage devices in a layout that spreads the operating system work around. Having {{ic|/}} {{ic|/home}} {{ic|/var}} and {{ic|/usr}} on separate disks is dramatically faster than a single disk layout where they are all on the same hard drive.<br />
<br />
==== Swap files ====<br />
<br />
Creating your swap files on a separate disk can also help quite a bit, especially if your machine swaps frequently. It happens if you do not have enough RAM for your environment. Using KDE with all the features and applications that come along may require several GiB of memory, whereas a tiny window manager with console applications will perfectly fit in less than 512 MiB of memory.<br />
<br />
==== RAID benefits ====<br />
<br />
If you have multiple disks available, you can set them up as a software [[RAID]] for serious speed improvements. In a RAID 0 array there is no redundancy in case of drive failure, but for each additional disk you add to the array, the speed of the disk becomes that much faster.<br />
<br />
==== Multiple hardware paths ====<br />
<br />
An internal hardware path is how the storage device is connected to your motherboard. There are different ways to connect to the motherboard such as TCP/IP through a NIC, plugged in directly using PCIe/PCI, Firewire, Raid Card, USB, etc. By spreading your storage devices across these multiple connection points you maximize the capabilities of your motherboard, for example 6 hard-drives connected via USB would be much much slower than 3 over USB and 3 over Firewire. The reason is that each entry path into the motherboard is like a pipe, and there is a set limit to how much can go through that pipe at any one time. The good news is that the motherboard usually has several pipes.<br />
<br />
More Examples<br />
# Directly to the motherboard using pci/PCIe/ata<br />
# Using an external enclosure to house the disk over USB/Firewire<br />
# Turn the device into a network storage device by connecting over tcp/ip<br />
<br />
Note also that if you have a 2 USB ports on the front of your machine, and 4 USB ports on the back, and you have 4 disks, it would probably be fastest to put 2 on front/2 on back or 3 on back/1 on front. This is because internally the front ports are likely a separate Root Hub than the back, meaning you can send twice as much data by using both than just 1. Use the following commands to determine the various paths on your machine.<br />
<br />
{{hc|USB Device Tree|$ lsusb -tv}}<br />
<br />
{{hc|PCI Device Tree|$ lspci -tv}}<br />
<br />
=== Partitioning ===<br />
<br />
If using a traditional spinning HDD, your partition layout can influence the system's performance. Sectors at the beginning of the drive (closer to the outside of the disk) are faster than those at the end. Also, a smaller partition requires less movements from the drive's head, and so speed up disk operations. Therefore, it is advised to create a small partition (10GB, more or less depending on your needs) only for your system, as near to the beginning of the drive as possible. Other data (pictures, videos) should be kept on a separate partition, and this is usually achieved by separating the home directory ({{ic|/home/''user''}}) from the system ({{ic|/}}).<br />
<br />
=== Choosing and tuning your filesystem ===<br />
<br />
Choosing the best filesystem for a specific system is very important because each has its own strengths. The [[File systems]] article provides a short summary of the most popular ones. You can also find relevant articles [[:Category:File systems|here]].<br />
<br />
==== Mount options ====<br />
<br />
The [[fstab#Field definitions|mount options]] {{ic|noatime}} and {{ic|nodiratime}} are known to improve performance on almost all file systems. {{ic|noatime}} is a superset of {{ic|nodiratime}}, as {{ic|nodiratime}} applies to directories only, whereas {{ic|noatime}} applies to both files and directories. In rare cases, for example if you use [[mutt]], these options can cause minor problems. You can use the {{ic|relatime}} option instead, which is a default option.<br />
<br />
Other mount options are filesystem specific, therefore see the relevant articles for the filesystems:<br />
<br />
* [[Ext3]]<br />
* [[Ext4]]: [[Ext4#Tips and tricks|Tips and tricks]]<br />
* [[JFS Filesystem|JFS]]: [[JFS Filesystem#Optimizations|Optimizations]]<br />
* [[XFS]]<br />
* [[Btrfs]]: [[Btrfs#Defragmentation|Defragmentation]] and [[Btrfs#Compression|Compression]]<br />
<br />
===== Reiserfs =====<br />
<br />
The {{Ic|1=data=writeback}} mount option improves speed, but may corrupt data during power loss. The {{Ic|notail}} mount option increases the space used by the filesystem by about 5%, but also improves overall speed. You can also reduce disk load by putting the journal and data on separate drives. This is done when creating the filesystem: <br />
<br />
# mkreiserfs –j /dev/sd'''a1''' /dev/sd'''b1'''<br />
<br />
Replace {{ic|/dev/sd'''a1'''}} with the partition reserved for the journal, and {{ic|/dev/sd'''b1'''}} with the partition for data. You can learn more about reiserfs with this [http://www.funtoo.org/Funtoo_Filesystem_Guide,_Part_2 article].<br />
<br />
=== Tuning kernel parameters ===<br />
<br />
There are several key tunables affecting the performance of block devices, see [[sysctl#Virtual memory]] for more information.<br />
<br />
=== Compressing /usr ===<br />
<br />
{{Note|As of version 3.0 of the Linux kernel, aufs2 is no longer supported.}}<br />
{{out of date|aufs is no longer in the official repos. Also, read the Note box above.}}<br />
A way to speed up reading from the hard drive is to compress the data, because there is less data to be read. It must however be decompressed, which means a greater CPU load. Some file systems support transparent compression, most notably Btrfs and reiserfs4, but their compression ratio is limited by the 4k block size. A good alternative is to compress {{ic|/usr}} in a squashfs file, with a 64k(128k) block size, as instructed in this [http://forums.gentoo.org/viewtopic-t-646289.html Gentoo forums thread]. What this tutorial does is basically to compress the {{ic|/usr}} folder into a compressed squashfs file-system, then mounts it with aufs. A lot of space is saved, usually two thirds of the original size of {{ic|/usr}}, and applications load faster. However, each time an application is installed or reinstalled, it is written uncompressed, so {{ic|/usr}} must be re-compressed periodically. Squashfs is already in the kernel, and aufs2 is in the official repositories, so no kernel compilation is needed if using the stock kernel.<br />
Since the linked guide is for Gentoo, the next commands outline the steps specifically for Arch. To get it working, [[pacman|install]] the packages aufs2 and {{pkg|squashfs-tools}}. These packages provide the aufs-modules and some userspace-tools for the squash-filesystem.<br />
<br />
Now we need some extra directories where we can store the archive of {{ic|/usr}} as read-only and another folder where we can store the data changed after the last compression as writeable:<br />
# mkdir -p /squashed/usr/{ro,rw}<br />
Now that we got a rough setup you should perform a complete system-upgrade since every change of content in {{ic|/usr}} after the compression will be excluded from this speedup. If you use prelink you should also perform a complete prelink before creating the archive. Now it is time to invoke the command to compress {{ic|/usr}}:<br />
# mksquashfs /usr /squashed/usr/usr.sfs -b 65536<br />
These parameters/options are the ones suggested by the Gentoo link but there might be some room for improvement using some of the options described [http://www.tldp.org/HOWTO/SquashFS-HOWTO/mksqoverview.html#mksqusing here].<br />
Now to get the archive mounted together with the writeable folder it is necessary to edit {{ic|/etc/fstab}} and add the following lines:<br />
/squashed/usr/usr.sfs /squashed/usr/ro squashfs loop,ro 0 0 <br />
usr /usr aufs udba=reval,br:/squashed/usr/rw:/squashed/usr/ro 0 0<br />
Now you should be done and able to reboot. The original author suggests to delete all the old content of {{ic|/usr}}, but this might cause some problems if anything goes wrong during some later re-compression. It is safer to leave the old files in place.<br />
<br />
A [https://bbs.archlinux.org/viewtopic.php?pid=714052 Bash script] has been created that will automate the process of re-compressing (read updating) the archive since the tutorial is meant for Gentoo and some options do not correlate to what they should be in Arch.<br />
<br />
=== Tuning for an SSD ===<br />
<br />
[[SSD#Tips_for_Maximizing_SSD_Performance]]<br />
<br />
=== RAM disks / tuning for really slow disks ===<br />
<br />
* [http://cs.joensuu.fi/~mmeri/usbraid/ USB stick RAID] - RAELLY old article, uses deprecated or otherwise obsolete tools & techniques<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=493773#p493773 Combine RAM disk with disk in RAID]<br />
<br />
=== USB storage devices ===<br />
<br />
{{Expansion|provide better description, or at least some reference}}<br />
{{Accuracy|How should using KDE affect the copy speed?}}<br />
<br />
If you experienced slow copy speed to pendrive (mainly in KDE), then append these three lines in a [[systemd]] tmpfile:<br />
<br />
{{hc|/etc/tmpfiles.d/local.conf|<br />
w /sys/kernel/mm/transparent_hugepage/enabled - - - - madvise<br />
w /sys/kernel/mm/transparent_hugepage/defrag - - - - madvise<br />
w /sys/kernel/mm/transparent_hugepage/khugepaged/defrag - - - - 0<br />
}}<br />
<br />
See also [[sysctl#Virtual memory]].<br />
<br />
== CPU ==<br />
<br />
The only way to directly improve CPU speed is overclocking. As it is a complicated and risky task, it is not recommended for anyone except experts. The best way to overclock is through the BIOS. When purchasing your system, keep in mind that most Intel motherboards are notorious for disabling the capability to overclock.<br />
<br />
Many Intel i5 and i7 chips, even when overclocked properly through the BIOS or UEFI interface, will not report the correct clock frequency to acpi_cpufreq and most other utilities. This will result in excessive messages in dmesg about delays unless the module acpi_cpufreq is unloaded and blacklisted. The only tool known to correctly read the clock speed of these overclocked chips under Linux is i7z. The {{Pkg|i7z}} package is available in the community repo and {{AUR|i7z-git}} is available in the [[AUR]].<br />
<br />
A way to modify performance ([http://lkml.org/lkml/2009/9/6/136 ref]) is to use Con Kolivas' desktop-centric kernel patchset, which, among other things, replaces the Completely Fair Scheduler (CFS) with the Brain Fuck Scheduler (BFS).<br />
<br />
Kernel PKGBUILDs that include the BFS patch can be installed from the [[AUR]] or [[Unofficial user repositories]]. See the respective pages for {{AUR|linux-ck}} and [[Linux-ck]] wiki page, {{AUR|linux-pf}} [[Linux-pf]] wiki page or {{AUR|linux-bfs}} for more information on their additional patches.<br />
<br />
{{Note|BFS/CK are designed for desktop/laptop use and not servers. They provide low latency and work well for 16 CPUs or less. Also, Con Kolivas suggests setting HZ to 1000. For more information, see the [http://ck.kolivas.org/patches/bfs/bfs-faq.txt BFS FAQ] and [http://users.on.net/~ckolivas/kernel/ Kernel patch homepage of Con Kolivas].}}<br />
<br />
=== Verynice ===<br />
<br />
[[VeryNice]] is a daemon, available in the [[AUR]] as {{AUR|verynice}}, for dynamically adjusting the nice levels of executables. The nice level represents the priority of the executable when allocating CPU resources. Simply define executables for which responsiveness is important, like X or multimedia applications, as ''goodexe'' in {{ic|/etc/verynice.conf}}. Similarly, CPU-hungry executables running in the background, like make, can be defined as ''badexe''. This prioritization greatly improves system responsiveness under heavy load.<br />
<br />
=== Ulatencyd ===<br />
<br />
[[Ulatencyd]] is a daemon that controls how the Linux kernel will spend its resources on the running processes. It uses dynamic cgroups to give the kernel hints and limitations on processes. It supports prioritizing processes for disk I/O as well as CPU shares, and uses more clever heuristics than Verynice. In addition, it comes with a good set of configs out of the box.<br />
<br />
One note of warning, by default it changes the default scheduler of all block devices to cfq, to disable behavior see [[Ulatencyd]].<br />
<br />
=== irqbalance ===<br />
<br />
The purpose of {{Pkg|irqbalance}} is distribute hardware interrupts across processors on a multiprocessor system in order to increase performance. It can be [[systemd#Using units|controlled]] by the provided {{ic|irqbalance.service}}.<br />
<br />
== Graphics ==<br />
<br />
=== Xorg.conf configuration ===<br />
<br />
Graphic performance heavily depends on the settings in {{ic|/etc/X11/xorg.conf}}. There are tutorials for [[NVIDIA]], [[ATI]] and [[Intel]] cards. Improper settings may stop Xorg from working, so caution is advised.<br />
<br />
=== Driconf ===<br />
<br />
{{Pkg|driconf}} is a small utility that can be found in the [[official repositories]] that allows you to change the direct rendering settings for open source drivers. Enabling HyperZ can drastically improve performance.<br />
<br />
=== GPU overclocking ===<br />
{{Out of date|GMABooster is for older intel chips.}}<br />
Overclocking a graphics card is typically more expedient than with a CPU, since there are readily accessible software packages which allow for on-the-fly GPU clock adjustments. For ATI users, get {{AUR|rovclock}} or {{AUR|amdoverdrivectrl}}, and NVIDIA users should get {{AUR|nvclock}} from the AUR. Intel chipsets users can install [http://www.gmabooster.com/ GMABooster] from with the {{AUR|gmabooster}} AUR package.<br />
<br />
The changes can be made permanent by running the appropriate command after X boots, for example by adding it to {{ic|~/.xinitrc}}. A safer approach would be to only apply the overclocked settings when needed.<br />
<br />
== RAM and swap ==<br />
<br />
=== Relocate files to tmpfs ===<br />
{{Out of date|/tmp configured using tmpfs is now considered the standard method and is included in the beginner's installation guide.}}<br />
Relocate files, such as your browser profile, to a [[Wikipedia:tmpfs|tmpfs]] file system, including {{ic|/tmp}}, or {{ic|/dev/shm}} for improvements in application response as all the files are now stored in RAM.<br />
<br />
Use an active management script for maximal reliability and ease of use. <br />
<br />
Refer to the [[Profile-sync-daemon]] wiki article for more information on syncing browser profiles.<br />
<br />
Refer to the [[Anything-sync-daemon]] wiki article for more information on syncing any specified folder.<br />
<br />
=== Swappiness ===<br />
<br />
See [[Swap#Swappiness]].<br />
<br />
=== Compcache/Zram ===<br />
<br />
[https://code.google.com/p/compcache/ Compcache], nowadays replaced by the '''zram''' kernel module, creates a device in RAM and compresses it. If you use for swap means that part of the RAM can hold much more information but uses more CPU. Still, it is much quicker than swapping to a hard drive. If a system often falls back to swap, this could improve responsiveness. Zram is considered stable as of kernel 3.14 ([http://kernelnewbies.org/Linux_3.14#head-72b295b09fea85de2e80f0b7850048264fed887e Kernel Newbies report]), so be careful if using an older kernel version.<br />
<br />
The AUR package {{AUR|zramswap}} provides an automated script for setting up such swap devices with optimal settings for your system (such as RAM size and CPU core number). The script creates one zram device per CPU core with a total space equivalent to the RAM available. To do this automatically on every boot, enable {{ic|zramswap.service}} via [[systemd#Basic systemctl usage|systemctl]]. <br />
<br />
You will have a compressed swap with higher priority than your regular swap which will utilize multiple CPU cores for compessing data.<br />
<br />
{{Tip|Using zram is also a good way to reduce disk read/write cycles due to swap on SSDs.}}<br />
<br />
=== Using the graphic card's RAM ===<br />
<br />
In the unlikely case that you have very little RAM and a surplus of video RAM, you can use the latter as swap. See [[Swap on video ram]].<br />
<br />
=== Preloading ===<br />
<br />
Preloading is the action of putting and keeping target files into the RAM. The benefit is that preloaded applications start more quickly because reading from the RAM is always quicker than from the hard drive. However, part of your RAM will be dedicated to this task, but no more than if you kept the application open. Therefore preloading is best used with large and often-used applications like Firefox and LibreOffice.<br />
<br />
==== Go-preload ====<br />
<br />
{{AUR|gopreload-git}} is a small daemon created in the [http://forums.gentoo.org/viewtopic-t-789818-view-next.html?sid=5457cff93039fc7d4a3e445ef90f9821 Gentoo forum]. To use it, first run this command in a terminal for each program you want to preload at boot:<br />
# gopreload-prepare program<br />
<br />
For regular users, take ownership of {{ic|/usr/share/gopreload/enabled}} and {{ic|/usr/share/gopreload/disabled}}<br />
# chown username:users /usr/share/gopreload/enabled /usr/share/gopreload/disabled<br />
and then gopreload each program you want to preload:<br />
$ gopreload-prepare program<br />
<br />
Then, as instructed, press Enter when the program is fully loaded. This will add a list of files needed by the program in {{ic|/usr/share/gopreload/enabled}}. To load all lists at boot, enable the systemd service file:<br />
# systemctl enable gopreload.service<br />
<br />
To disable the loading of a program, remove the appropriate list in {{ic|/usr/share/gopreload/enabled}} or move it to {{ic|/usr/share/gopreload/disabled}}.<br />
<br />
==== Preload ====<br />
<br />
A more automated approach is used by [[Preload]]. All you have to do is enable it with this command:<br />
# systemctl enable preload<br />
It will monitor the most used files on your system, and with time build its own list of files to preload at boot.<br />
<br />
== Boot time ==<br />
<br />
You can find tutorials with good tips in the article [[Improve boot performance]].<br />
<br />
=== Suspend to RAM ===<br />
<br />
The best way to reduce boot time is not booting at all. Consider [[Suspend and hibernate#Suspend to RAM|suspending your system to RAM]] instead.<br />
<br />
== Network ==<br />
<br />
Use a DNS caching server in your local network. Every time a connections is made, the TCP/IP stack must resolve a fully qualified donamin name to an IP address. Only then the connection can be done. To use a DNS caching server directly present in your local network will decreases the latency on new connections. Your DSL router should contain such server, if not you can install your own. See [[Dnsmasq]] for more details.<br />
<br />
== Application-specific tips ==<br />
<br />
=== Firefox ===<br />
<br />
See [[Firefox tweaks#Performance]] and [[Firefox Ramdisk]].<br />
<br />
Firefox in the official repositories is built with the profile guided optimization flag enabled. You may want to use it in your custom build.<br />
To do this append:<br />
ac_add_options --enable-profile-guided-optimization<br />
to your {{ic|.mozconfig}} file.<br />
<br />
=== Gcc/Makepkg ===<br />
<br />
See [[Ccache]].<br />
<br />
=== Office suites ===<br />
<br />
See [[LibreOffice#Speed up LibreOffice|Speed up LibreOffice]] and [[Openoffice#Speed up OpenOffice|Speed up OpenOffice]].<br />
<br />
=== Pacman ===<br />
<br />
See [[Improve pacman performance]].<br />
<br />
=== SSH ===<br />
<br />
See [[SSH#Speeding up SSH|Speed up SSH]].<br />
<br />
== Laptops ==<br />
<br />
See [[Laptop]].</div>Overandhttps://wiki.archlinux.org/index.php?title=Shfs&diff=252879Shfs2013-04-04T15:19:02Z<p>Overand: </p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Secure Shell]]<br />
'''Shfs''' is a simple and easy to use Linux kernel module which allows you to mount remote filesystems using a plain shell (ssh) connection. When using shfs, you can access all remote files just like the local ones, only the access is governed through the transport security of ssh.<br />
<br />
Note that the FUSE-based [[Sshfs]] is much more widely used, as shfs has not been updated since 2004.<br />
<br />
==Why SHFS?==<br />
Shfs supports some nice features:<br />
<br />
* file cache for access speedup<br />
* perl and shell code for the remote (server) side<br />
* could preserve uid/gid (root connection)<br />
* number of remote host platforms (Linux, Solaris, Cygwin, ...)<br />
* Linux kernel 2.4.10+ and 2.6<br />
* arbitrary command used for connection (instead of ssh)<br />
* persistent connection (reconnect after ssh dies)<br />
<br />
If these features cannot convince you, I probably cannot either. Yet, consider: the only thing you need on the server is a sshd running - and you can mount your filesystem from '''anywhere''' in a '''secure''' way.<br />
<br />
==Howto SHFS==<br />
In order to use shfs it needs to be installed and configured on the client side, NOT on the server side! Server only needs to have working sshd running.<br />
<br />
===Installation===<br />
If you have standard Arch-kernel installed and [[AUR|community repo]] [[AUR User Guidelines#.5Bcommunity.5D|enabled]] in [[pacman]], the installation is very simple:<br />
# pacman -S shfs-utils<br />
<br />
In other cases (e.g. if you run a self-baked kernel), you need to compile shfs first for yourself. There is a PKGBUILD and other needed files in [[AUR]], just download them manually or even simpler, if you have [[ABS]] [[AUR User Guidelines#.5Bcommunity.5D|configured]] to use build files from community repo, just update your local [[ABS#The_ABS_tree|abs tree]]:<br />
# abs community/shfs-utils<br />
<br />
Then change to the directory where the files are downloaded and run makepkg (do not need to be root):<br />
$ cd /var/abs/community/shfs-utils<br />
$ makepkg<br />
This should make a working package, which can be easily installed (under root):<br />
# pacman -A ./shfs-utils*.pkg.tar.gz<br />
<br />
===Configuration===<br />
If you want to use shfsmount as mortal user, you will have to {{ic|chmod +s /usr/bin/shfsmount}} and {{ic|chmod + /usr/bin/shfsumount}}. However it is much more comfortable to put your mount options into {{ic|/etc/fstab}} - this is what mine looks like:<br />
remoteuser@Server:/data /mnt/data shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/crap /mnt/crap shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/backup /mnt/backup shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/home /mnt/home shfs rw,noauto,uid=localuser,persistent 0 0<br />
<br />
Soon you will get tired typing passwords and once you do, you might consider [[Using SSH Keys]].<br />
<br />
Btw, if you are a paranoid bastard, like I am, and do not run ssh on port 22 on your server, you will need to complete your option list with {{ic|1=port=<portnumber>}}.<br />
<br />
===/etc/fstab===<br />
To add an entry for an shfs volume in your fstab, add a line of the format:<br />
userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0<br />
(Came from [http://ubuntuforums.org/archive/index.php/t-30332.html Ubuntu Forums]).<br />
<br />
==See Also==<br />
* [[Sshfs]] - A more up-to-date, FUSE-based implementation of an SSH-based filesystem.<br />
<br />
==External Links==<br />
*[http://shfs.sourceforge.net/ http://shfs.sourceforge.net/] for a supposed to be complete reference.<br /><br />
*[http://www.openssh.com/ http://www.openssh.com/] for a really complete reference ;)</div>Overandhttps://wiki.archlinux.org/index.php?title=Shfs&diff=252878Shfs2013-04-04T15:18:08Z<p>Overand: SSHFS links and info included</p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Secure Shell]]<br />
'''Shfs''' is a simple and easy to use Linux kernel module which allows you to mount remote filesystems using a plain shell (ssh) connection. When using shfs, you can access all remote files just like the local ones, only the access is governed through the transport security of ssh.<br />
<br />
Note that the [[FUSE]]-based [[SSHFS]] is much more widely used, as shfs has not been updated since 2004.<br />
<br />
==Why SHFS?==<br />
Shfs supports some nice features:<br />
<br />
* file cache for access speedup<br />
* perl and shell code for the remote (server) side<br />
* could preserve uid/gid (root connection)<br />
* number of remote host platforms (Linux, Solaris, Cygwin, ...)<br />
* Linux kernel 2.4.10+ and 2.6<br />
* arbitrary command used for connection (instead of ssh)<br />
* persistent connection (reconnect after ssh dies)<br />
<br />
If these features cannot convince you, I probably cannot either. Yet, consider: the only thing you need on the server is a sshd running - and you can mount your filesystem from '''anywhere''' in a '''secure''' way.<br />
<br />
==Howto SHFS==<br />
In order to use shfs it needs to be installed and configured on the client side, NOT on the server side! Server only needs to have working sshd running.<br />
<br />
===Installation===<br />
If you have standard Arch-kernel installed and [[AUR|community repo]] [[AUR User Guidelines#.5Bcommunity.5D|enabled]] in [[pacman]], the installation is very simple:<br />
# pacman -S shfs-utils<br />
<br />
In other cases (e.g. if you run a self-baked kernel), you need to compile shfs first for yourself. There is a PKGBUILD and other needed files in [[AUR]], just download them manually or even simpler, if you have [[ABS]] [[AUR User Guidelines#.5Bcommunity.5D|configured]] to use build files from community repo, just update your local [[ABS#The_ABS_tree|abs tree]]:<br />
# abs community/shfs-utils<br />
<br />
Then change to the directory where the files are downloaded and run makepkg (do not need to be root):<br />
$ cd /var/abs/community/shfs-utils<br />
$ makepkg<br />
This should make a working package, which can be easily installed (under root):<br />
# pacman -A ./shfs-utils*.pkg.tar.gz<br />
<br />
===Configuration===<br />
If you want to use shfsmount as mortal user, you will have to {{ic|chmod +s /usr/bin/shfsmount}} and {{ic|chmod + /usr/bin/shfsumount}}. However it is much more comfortable to put your mount options into {{ic|/etc/fstab}} - this is what mine looks like:<br />
remoteuser@Server:/data /mnt/data shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/crap /mnt/crap shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/backup /mnt/backup shfs rw,noauto,uid=localuser,persistent 0 0<br />
remoteuser@Server:/home /mnt/home shfs rw,noauto,uid=localuser,persistent 0 0<br />
<br />
Soon you will get tired typing passwords and once you do, you might consider [[Using SSH Keys]].<br />
<br />
Btw, if you are a paranoid bastard, like I am, and do not run ssh on port 22 on your server, you will need to complete your option list with {{ic|1=port=<portnumber>}}.<br />
<br />
===/etc/fstab===<br />
To add an entry for an shfs volume in your fstab, add a line of the format:<br />
userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0<br />
(Came from [http://ubuntuforums.org/archive/index.php/t-30332.html Ubuntu Forums]).<br />
<br />
==See Also==<br />
* [[SSHFS]] - A more up-to-date, [[FUSE]]-based implementation of an SSH-based filesystem.<br />
<br />
==External Links==<br />
*[http://shfs.sourceforge.net/ http://shfs.sourceforge.net/] for a supposed to be complete reference.<br /><br />
*[http://www.openssh.com/ http://www.openssh.com/] for a really complete reference ;)</div>Overand