{"id":2659,"date":"2016-02-12T13:26:17","date_gmt":"2016-02-12T11:26:17","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=2659"},"modified":"2019-03-27T09:23:46","modified_gmt":"2019-03-27T07:23:46","slug":"make-ubuntu-or-applications-run-faster","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/make-ubuntu-or-applications-run-faster\/","title":{"rendered":"Make ubuntu or applications run faster"},"content":{"rendered":"<pre>\r\n<strong>See also<\/strong>\r\n<a href=\"https:\/\/doc.ubuntu-fr.org\/optimisation\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/doc.ubuntu-fr.org\/optimisation<\/a>\r\n\r\n<strong>Check ubuntu startup times<\/strong>\r\nsystemd-analyze blame\r\n\r\n<strong>\/etc\/fstab<\/strong>\r\n<a href=\"http:\/\/www.lgqyc.com\/move-tmp-to-ram\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.lgqyc.com\/move-tmp-to-ram\/<\/a>\r\n<a href=\"http:\/\/jsmylinux.no-ip.org\/performance\/improving-performance\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/jsmylinux.no-ip.org\/performance\/improving-performance\/<\/a>\r\n<a href=\"http:\/\/askubuntu.com\/questions\/173094\/how-can-i-use-ram-storage-for-the-tmp-directory-and-how-to-set-a-maximum-amount\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/askubuntu.com\/questions\/173094\/how-can-i-use-ram-storage-for-the-tmp-directory-and-how-to-set-a-maximum-amount<\/a>\r\n<a href=\"http:\/\/www.digitalinternals.com\/unix\/linux-io-performance-tuning-noatime-nodiratime-relatime\/388\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.digitalinternals.com\/unix\/linux-io-performance-tuning-noatime-nodiratime-relatime\/388\/<\/a>\r\n\r\nmount | grep -P \"^tmpfs.+\/(tmp|var\/run)\"\r\nsudo du -sh \/tmp \/var\/tmp; du -sh \/********\/apps\/tmp \/********\/apps\/var\/run \/run\/user\/`id -u` \/tmp\/tomcat 2&gt;\/dev\/null\r\n \r\ntmpfs \/tmp tmpfs defaults,relatime,mode=1777,size=4G 0 0\r\ntmpfs \/var\/tmp tmpfs defaults,relatime,mode=1777,size=99G 0 0\r\ntmpfs \/********\/apps\/tmp tmpfs defaults,relatime,mode=1777,size=2G 0 0\r\ntmpfs \/********\/apps\/run tmpfs rw,nosuid,noexec,relatime,mode=755,size=2G 0 0\r\n\r\n<strong>Firefox cache<\/strong>\r\nsee also <a href=\"http:\/\/kb.mozillazine.org\/Browser.cache.memory.capacity\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/kb.mozillazine.org\/Browser.cache.memory.capacity<\/a>\r\nsee also <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Firefox_on_RAM\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.archlinux.org\/index.php\/Firefox_on_RAM<\/a>\r\n\r\nMain disadvantages of this method are that the content of currently browsed web pages is lost if browser \r\ncrashes or after a reboot, and that the settings need to be configured for each user individually.\r\n\r\nOpen the url: about:config.\r\nbrowser.cache.disk.enable false\r\nbrowser.cache.disk.capacity 512000 -&gt; 500M\r\nbrowser.cache.memory.max_entry_size 512000 -&gt; 500M appcache\r\nbrowser.cache.memory.enable true\r\nbrowser.cache.memory.capacity 1048576 -&gt; 1G RAM\r\nSee the result in about:cache?device=memory (might require a firefox restart).\r\n\r\n<strong>Increase the Speed at Which Firefox loads pages<\/strong>\r\nsee also <a href=\"http:\/\/bgr.com\/2009\/01\/25\/a-handful-of-firefox-tweaks-that-will-double-your-browser-speed\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/bgr.com\/2009\/01\/25\/a-handful-of-firefox-tweaks-that-will-double-your-browser-speed\/<\/a>\r\nsee also <a href=\"http:\/\/www.techfragments.com\/481\/the-12-best-firefox-aboutconfig-performance-tweaks\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.techfragments.com\/481\/the-12-best-firefox-aboutconfig-performance-tweaks\/<\/a>\r\n\r\n1. Type \u201cabout:config\u201d into the address bar and hit Enter.\r\n(Normally the browser will make one request to a web page at a time. When you enable pipelining it will make several at once, which really speeds up page loading.)\r\n\r\n2. Alter the entries as follows:\r\nSet \u201cnetwork.http.pipelining\u201d to \u201ctrue\u201d\r\nSet \"network.http.pipelining.ssl\u201d to \u201ctrue\u201d\r\nsee also <a href=\"http:\/\/kb.mozillazine.org\/Network.http.proxy.pipelining\" target=\"_blank\" rel=\"noopener noreferrer\">network.http.proxy.pipelining<\/a>\r\n<a href=\"http:\/\/kb.mozillazine.org\/Network.http.pipelining.maxrequests\" target=\"_blank\" rel=\"noopener noreferrer\">network.http.pipelining.maxrequests<\/a> -&gt; default 32; modified to 6\r\n<a href=\"http:\/\/kb.mozillazine.org\/Content.notify.ontimer\" target=\"_blank\" rel=\"noopener noreferrer\">content.notify.ontimer<\/a> -&gt; created with value true (default anyway)\r\n<a href=\"http:\/\/kb.mozillazine.org\/Content.notify.backoffcount\" target=\"_blank\" rel=\"noopener noreferrer\">content.notify.backoffcount<\/a> -&gt; created with value 3 (default -1)\r\n<a href=\"http:\/\/kb.mozillazine.org\/Content.notify.interval\" target=\"_blank\" rel=\"noopener noreferrer\">content.notify.interval<\/a> -&gt; default 120 000 microseconds; modified to 500 000\r\n\r\n<strong>Chromium cache<\/strong>\r\nsee also <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Chromium\/Tips_and_tricks#Tmpfs\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.archlinux.org\/index.php\/Chromium\/Tips_and_tricks#Tmpfs<\/a>\r\nsee also the cache <a href=\"chrome:\/\/cache\/\" target=\"_blank\" rel=\"noopener noreferrer\">chrome:\/\/cache\/<\/a> -> takes an age to load ...\r\nAllocate Chromium 1G of disk cache by modifying in any chromium-browser.desktop (Exec=chromium-browser lines):\r\nchromium-browser --disk-cache-size=1073741824 --disk-cache-dir=\/var\/tmp\/chromium-cache ...\r\nsee also <a href=\"https:\/\/www.chromium.org\/user-experience\/user-data-directory\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.chromium.org\/user-experience\/user-data-directory<\/a>\r\n\r\n<strong>Improve chrome performance<\/strong>\r\nNavigate to <a href=\"chrome:\/\/flags\" target=\"_blank\" rel=\"noopener noreferrer\">chrome:\/\/flags<\/a> and <a href=\"chrome:\/\/gpu\/\" target=\"_blank\" rel=\"noopener noreferrer\">chrome:\/\/gpu\/<\/a>.\r\nSee video card info at <a href=\"https:\/\/adrhc.go.ro\/wordpress\/ubuntu-errors-problems-tips-tricks\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/adrhc.go.ro\/wordpress\/ubuntu-errors-problems-tips-tricks\/<\/a>\r\n\r\nEnable these in chrome:\/\/flags\/:\r\nEnable experimental canvas features\r\nOverride software rendering list - canceled\r\nNumber of raster threads - 4\r\nEnable GPU rasterization\r\nEnable zero-copy rasterizer\r\nSimple Cache for HTTP\r\nDisable touch adjustment\r\nEnable TCP Fast Open\r\nLCD text antialiasing\r\nEnable Download Resumption\r\n\r\nDisable these in chrome:\/\/flags\/:\r\nEnable touch events\r\nEnable pinch scale\r\n\r\nStartup parameters:\r\ngrep \"Exec=\" \/usr\/share\/applications\/chromium-browser.desktop\r\ngrep \"Exec=\" $HOME\/.local\/share\/applications\/chromium-browser.desktop\r\nExec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=\/var\/tmp\/chromium-cache --enable-native-gpu-memory-buffers %U\r\nExec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=\/var\/tmp\/chromium-cache --enable-native-gpu-memory-buffers\r\nExec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=\/var\/tmp\/chromium-cache --enable-native-gpu-memory-buffers --incognito\r\nExec=chromium-browser --process-per-site --disk-cache-size=1073741824 --disk-cache-dir=\/var\/tmp\/chromium-cache --enable-native-gpu-memory-buffers --temp-profile\r\n\r\n<strong>Firefox &amp; Chromium profile<\/strong>\r\nsee also <a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=1921800&amp;page=2\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/ubuntuforums.org\/showthread.php?t=1921800&amp;page=2<\/a>\r\nsee also <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Profile-sync-daemon\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.archlinux.org\/index.php\/Profile-sync-daemon<\/a>\r\nsee also <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Anything-sync-daemon\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.archlinux.org\/index.php\/Anything-sync-daemon<\/a>\r\nsudo add-apt-repository ppa:graysky\/utils\r\nsudo apt-get update\r\nsudo apt-get install profile-sync-daemon\r\npsd p -&gt; creates \/********\/.config\/psd\/psd.conf\r\nPrimary configuration:\r\ngedit \/********\/.config\/psd\/psd.conf\r\nUSERS=\"gigi bob\"\r\nUSE_OVERLAYFS=\"yes\"\r\nBROWSERS=\"chromium\"\r\nUSE_BACKUPS=\"yes\"\r\nAdd to \/etc\/sudoers (required by psd.service USE_OVERLAYFS=\"yes\"):\r\ngigi ALL=(ALL) NOPASSWD: \/usr\/bin\/psd-overlay-helper\r\nsecondary configuration\r\nmkdir -p ~\/.config\/systemd\/user\/psd-resync.timer.d\r\ngedit ~\/.config\/systemd\/user\/psd-resync.timer.d\/frequency.conf\r\n[Unit]\r\nDescription=Timer for Profile-sync-daemon\r\nPartOf=psd.service\r\n[Timer]\r\nOnUnitActiveSec=10m\r\nEnable &amp; start the service:\r\nsystemctl --user enable psd\r\nsystemctl --user start psd\r\nsystemctl --user status psd\r\nStop &amp; disable the service:\r\nsystemctl --user stop psd\r\nsystemctl --user disable psd\r\nCheck psd installation &amp; configuration:\r\nprofile-sync-daemon parse\r\npsd p\r\nls -l ~\/.mozilla\/firefox\/\r\nls -l \/run\/user\/`id -u`\r\n\r\n<strong>Plex<\/strong>\r\nServer -&gt; Transcoder: \/var\/tmp\/plex-transcoding\r\n\r\n<strong>Linux hdd defragmentation<\/strong>\r\nsee also <a href=\"http:\/\/www.hecticgeek.com\/2012\/10\/defragment-ext4-file-systems-using-e4defrag-ubuntu\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.hecticgeek.com\/2012\/10\/defragment-ext4-file-systems-using-e4defrag-ubuntu\/<\/a>\r\n\r\n<strong>HDD performance<\/strong>\r\nsee also <a href=\"https:\/\/www.kernel.org\/doc\/Documentation\/block\/queue-sysfs.txt\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.kernel.org\/doc\/Documentation\/block\/queue-sysfs.txt<\/a>\r\nsee also <a href=\"https:\/\/wiki.mikejung.biz\/Ubuntu_Performance_Tuning\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.mikejung.biz\/Ubuntu_Performance_Tuning<\/a>\r\nsee also <a href=\"https:\/\/wiki.mikejung.biz\/OS_Tuning\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/wiki.mikejung.biz\/OS_Tuning<\/a>\r\n\r\n<strong>hdd performance info<\/strong>\r\necho \"queue_depth: $(cat \/sys\/block\/sda\/device\/queue_depth)\"; echo \"nr_requests: $(cat \/sys\/block\/sda\/queue\/nr_requests)\"; echo \"read_ahead_kb: $(cat \/sys\/block\/sda\/queue\/read_ahead_kb)\"\r\necho \"queue_depth: $(cat \/sys\/block\/sdb\/device\/queue_depth)\"; echo \"nr_requests: $(cat \/sys\/block\/sdb\/queue\/nr_requests)\"; echo \"read_ahead_kb: $(cat \/sys\/block\/sdb\/queue\/read_ahead_kb)\"\r\n\r\nQueue_depth (default 31)\r\ncat \/sys\/block\/sda\/device\/queue_depth\r\ncat \/sys\/block\/sdb\/device\/queue_depth\r\n\r\nI\/O scheduler queue size (default 128)\r\nHow many requests may be allocated in the block layer for read or write requests.\r\ncat \/sys\/block\/sda\/queue\/nr_requests\r\nsu\t-&gt; won't work using sudo ...\r\necho 1024 &gt; \/sys\/block\/sda\/queue\/nr_requests\r\ncat \/sys\/block\/sdb\/queue\/nr_requests\r\nsu\r\necho 1024 &gt; \/sys\/block\/sdb\/queue\/nr_requests\r\n\r\nMaximum number of kilobytes to read-ahead\r\ncat \/sys\/block\/sda\/queue\/read_ahead_kb\t-&gt; default 128\r\ncat \/sys\/block\/sdb\/queue\/read_ahead_kb\r\n\r\nPrint readahead in 512-byte sectors (<a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/blockdev.8.html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/man7.org\/linux\/man-pages\/man8\/blockdev.8.html<\/a>)\r\nsudo blockdev --getra \/dev\/sda\t\t-&gt; default 256 (always double to read_ahead_kb above)\r\nsudo blockdev --getra \/dev\/sdb\r\n\r\nThis file (\/sys\/block\/sda\/queue\/add_random) allows to turn off the disk entropy contribution. Default value of this file is '1'(on).\r\ncat \/sys\/block\/sdb\/queue\/nr_requests\r\nsu\t-&gt; won't work using sudo ...\r\necho 1 &gt; \/sys\/block\/sdb\/queue\/nr_requests\r\n\r\nPersist using \/etc\/rc.local\r\nblockdev --setra 256 \/dev\/sda\r\necho 1 &gt; \/sys\/block\/sda\/queue\/add_random\r\n\r\n<strong>Disable IPv6 support<\/strong>\r\nCheck ipv6 status (1 = disabled)\r\ncat \/proc\/sys\/net\/ipv6\/conf\/all\/disable_ipv6\r\n\r\nAdd to \/etc\/sysctl.conf\r\nnet.ipv6.conf.all.disable_ipv6=1  \r\nnet.ipv6.conf.default.disable_ipv6=1  \r\nnet.ipv6.conf.lo.disable_ipv6=1\r\n\r\nDisable loading of ivp6 module into kernel during booting\r\nsee also <a href=\"http:\/\/linuxpoison.blogspot.com\/2009\/06\/how-to-disable-loading-of-unnecessary.html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/linuxpoison.blogspot.com\/2009\/06\/how-to-disable-loading-of-unnecessary.html<\/a>\r\nEdit \/etc\/modprobe.d\/blacklist.conf\r\nblacklist ipv6\r\n\r\n<strong>\/etc\/sysctl.conf<\/strong>\r\nvm.swappiness=1\r\nThis option controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects.\r\nAt the default value of vfs_cache_pressure=100 the kernel will attempt to reclaim dentries and inodes at a \"fair\" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. When vfs_cache_pressure=0, the kernel will never reclaim dentries and inodes due to memory pressure and this can easily lead to out-of-memory conditions. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.\r\nvm.vfs_cache_pressure=5\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>See also https:\/\/doc.ubuntu-fr.org\/optimisation Check ubuntu startup times systemd-analyze blame \/etc\/fstab http:\/\/www.lgqyc.com\/move-tmp-to-ram\/ http:\/\/jsmylinux.no-ip.org\/performance\/improving-performance\/ http:\/\/askubuntu.com\/questions\/173094\/how-can-i-use-ram-storage-for-the-tmp-directory-and-how-to-set-a-maximum-amount http:\/\/www.digitalinternals.com\/unix\/linux-io-performance-tuning-noatime-nodiratime-relatime\/388\/ mount | grep -P &#8220;^tmpfs.+\/(tmp|var\/run)&#8221; sudo du -sh \/tmp \/var\/tmp; du -sh \/********\/apps\/tmp \/********\/apps\/var\/run \/run\/user\/`id -u` \/tmp\/tomcat 2&gt;\/dev\/null tmpfs \/tmp tmpfs defaults,relatime,mode=1777,size=4G 0 0 tmpfs \/var\/tmp [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/make-ubuntu-or-applications-run-faster\/#more-2659\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Make ubuntu or applications run faster<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,11,33],"tags":[64],"class_list":["post-2659","post","type-post","status-publish","format-standard","hentry","category-configuration","category-linux","category-ubuntu","tag-performance"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=2659"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2659\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=2659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=2659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=2659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}