• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

FreeBSD with Gnome 3 is too slow on my fast hardware.

themazay

New Member

Thanks: 4
Messages: 9

#1
Hi all!

Some time ago I decided to use FreeBSD as a workstation.
Before this I have been using MS Windows.
It was my dream to migrate to FreeBSD.
Now I am using FreeBSD. I chose Gnome 3 classic view as it is enough modern and beauty for me. But I am not so happy, as I expected, of it now.
My system became slow.
When Tribler (torrent server) is run I unable to serf web in Chromium - it became frozen all the time. It became horrible to use the system at all. When I am installing software from ports all my system became frozen. Some time it does not answer upto timeout and Gnome offer me to log out.
I run a simple program written on Java, that copy files to some other destination and the system periodically stay in froze for all other UI application and even for Terminal run this java program.
I thought that my problem lays in multithreading, but top shows usage of all my CPU cores by different processes.
And when the system is in froze, top shows that it is easy loaded, just a few percents of usage CPU by couple of processes.
From the start of usage it I rebuilt kernel, switched off all unused devises.
I have been using it for a month.
It is look like my GUI works in single queue.

Whether this problem is just a normal work of Xorg?
Is it normal behavior or even normal life of Gnome 3?
Or may be there are some settings about what I do not know?
Your systems work as fast in GUI as Windows or IOS?

I noticed that all programs which periodically became frozen runs normally fast.

On MS Windows GUI I newer encountered such problems, I was able to run infinite amount of run programs without any froze.

My system is:
Intel core-i5 3450
RAM 12G DDR3
Nvidia GTX 760
OS installed on SSD hard drive.
FreeBSD 10.3-Release

I home for your help.
Wish to keep on using of FreeBSD.
 
A

ASX

Guest


#2
Gnome 3 is a relatively heavy desktop, but not up to the level you are describing, and your hardware look like enough performant.

I don't run Gnome 3, but I have tried it a couple of times ... and also several other desktop environment.

Your performance issue seems disk I/O bound, just my impression from your description, so I would investigate that first.

A few additional info would be useful:
Is video acceleration working properly ?
What filesystem type did you used ?
What is the brand/model of the SSD ?
And, if it is a 4K sector size, are partitions properly aligned ?
(partition misalignment can cause loss of performance up to 60%/70% ....)
 

themazay

New Member

Thanks: 4
Messages: 9

#3
Thank you for so fast reply, ASX!

>> Is video acceleration working properly ?
I have set it enabled in rc.conf, but vlc shows video without artifacts only if no other process is run, otherwise I could not view video. I set Xorg video output in vls. Other output types work bad.
If I disable settings of nvidia in rc.conf the Xorg will not run. I don't know another settings of an accelerator. In Xorg configuration file a proper string presents also.
rc.conf
Code:
kld_list="nvidia nvidia-modeset"
xorg.conf
Code:
Section "Device"
    Identifier  "Card0"
    Driver      "nvidia"
    BusID       "PCI:1:0:0"
EndSection
But when I scroll page up and down in a browser I see artifact in view of horizontally dividing of a page screen usually in middle of the page.

>> What filesystem type did you used ?
I use ufs.

>> What is the brand/model of the SSD ?
SSD SANDISK SDSSDP-128G-G25 128Гб, 2.5", SATA III

>> And, if it is a 4K sector size, are partitions properly aligned ?
Guess it is not.
dmesg
Code:
600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
gpart list
Code:
   Mediasize: 524288 (512K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   length: 524288
   offset: 17408
I used default settings when I was installing OS.
 
A

ASX

Guest


#4
I see the disk is recognized as 512 byte sector, but am not sure it is really that.

Assuming you have at least a few GB of free space ... try this fast test: (writing 2 GB file)
Code:
dd if=/dev/zero of=./testfile bs=1m count=1000 conv=sync
when done, please report back the output.

also, try this too: (300 MB, but in small 3k blocks)
Code:
dd if=/dev/zero of=./testfile2 bs=3k count=100000 conv=sync
when finished remove the two files: tempfile and tempfile2

please report also the following info:
Code:
dmesg | grep ada0 # assuming you disk is ada0 ...
gpart show -p ada0
diskinfo -ctv /dev/ada0
 

themazay

New Member

Thanks: 4
Messages: 9

#5
It looks like your guess is true.

$ dd if=/dev/zero of=./testfile bs=1m count=2000 conv=sync
Code:
2000+0 records in
2000+0 records out
2097152000 bytes transferred in 376.470705 secs (5570558 bytes/sec)
$ dd if=/dev/zero of=./testfile bs=2m count=1000 conv=sync
Code:
1000+0 records in
1000+0 records out
2097152000 bytes transferred in 223.498166 secs (9383307 bytes/sec)
$ dd if=/dev/zero of=./testfile bs=3K count=100000 conv=sync
Code:
100000+0 records in
100000+0 records out
307200000 bytes transferred in 52.139423 secs (5891895 bytes/sec)
dmesg | grep ada0 # assuming you disk is ada0 ...
Code:
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <SanDisk SDSSDP128G 3.2.0> ACS-2 ATA SATA 3.x device
ada0: Serial Number 1611924012350
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 120196MB (246162672 512 byte sectors)
ada0: Previously was known as ad4
Trying to mount root from ufs:/dev/ada0p2 [rw]...
gpart show -p ada0
Code:
=>       34  246162605    ada0  GPT  (117G)
         34       1024  ada0p1  freebsd-boot  (512K)
       1058  236977152  ada0p2  freebsd-ufs  (113G)
  236978210    8388608  ada0p3  freebsd-swap  (4.0G)
  245366818     795821          - free -  (389M)
diskinfo -ctv /dev/ada0
Code:
/dev/ada0
    512             # sectorsize
    126035288064    # mediasize in bytes (117G)
    246162672       # mediasize in sectors
    0               # stripesize
    0               # stripeoffset
    244209         # Cylinders according to firmware.
    16             # Heads according to firmware.
    63             # Sectors according to firmware.
    151192402782    # Disk ident.

I/O command overhead:
    time to read 10MB block      0.026965 sec    =    0.001 msec/sector
    time to read 20480 sectors   4.641637 sec    =    0.227 msec/sector
    calculated command overhead            =    0.225 msec/sector

Seek times:
    Full stroke:     250 iter in   0.066747 sec =    0.267 msec
    Half stroke:     250 iter in   0.066161 sec =    0.265 msec
    Quarter stroke:     500 iter in   0.123489 sec =    0.247 msec
    Short forward:     400 iter in   0.095027 sec =    0.238 msec
    Short backward:     400 iter in   0.094826 sec =    0.237 msec
    Seq outer:    2048 iter in   0.138125 sec =    0.067 msec
    Seq inner:    2048 iter in   0.124881 sec =    0.061 msec
Transfer rates:
    outside:       102400 kbytes in   0.445222 sec =   229998 kbytes/sec
    middle:        102400 kbytes in   0.250089 sec =   409454 kbytes/sec
    inside:        102400 kbytes in   0.227899 sec =   449322 kbytes/sec
 
A

ASX

Guest


#6
Yep, the disk read speed (from diskinfo) range between 229 and 449 MB/s, that look fine. (that's not affected from partition misalignment because diskinfo read the raw disk)

The write speed is very low, and is trashing the whole system: 5.5 to 9 MB/s, ...

Prepare yourself with a good backup of your data, I will post some more info later about how to fix your issue, most likely tomorrow ...
 

themazay

New Member

Thanks: 4
Messages: 9

#7
Hi ASX!
Today I have tested writing speed without run Gnome, even GDM.
The results was excellent:
$ dd if=/dev/zero of=./testfile bs=1m count=2000 conv=sync
Code:
1000+0 records in
1000+0 records out
2097152000 bytes transferred in 11.070943 secs (189428487 bytes/sec)
But the same results I got in Gnome Terminal in GUI.
After I run Chromium and other apps writing speed decreased downto
$ dd if=/dev/zero of=./tempfile bs=2m count=1000 conv=sync
Code:
1000+0 records in
1000+0 records out
2097152000 bytes transferred in 16.232155 secs (129197386 bytes/sec)
sometimes
Code:
2097152000 bytes transferred in 13.863744 secs (151268806 bytes/sec)
But when test is run, Chromium stays frozen.
So SSD is all right.
I continue to dig in side of Gnome3/Xorg multithreading troubles.

Some remarks: Gnome Terminal was run with nice 0, and Chromium with 5, but Tribler (python) with nice 7 and does not became frozen. Nautilus does not answer too.
 

themazay

New Member

Thanks: 4
Messages: 9

#9
I have been using my system for four years, the problem occurs after my migrating onto FreeBSD month ago. Trying to change data cable will be the last done thing, when I lose all hopes.
 
A

ASX

Guest


#10
Today I have tested writing speed without run Gnome, even GDM.
The results was excellent:
Indeed, your latest result look quite reasonable.
I was also thinking at the low results from yesterday tests, and honestly the values 5 ~ 9 MB/s were too low to be justified from misalignment only ... My bad, I accepted the results knowing they were too low ... clearly there was something else going on.

After I run Chromium and other apps writing speed decreased downto
To some extent this is expected, you have additional concurrent processes, and additional disk I/O load.
Are you using the "noatime" flag to mount your filesystem ? if not, the system will update the last access time for each opened/accessed file, even if the file is opened read-only, and chromium certainly open lot of files, thus causing a number of write requests.

But when test is run, Chromium stays frozen
This is what usually happens when the system is busy waiting for disk I/O to complete ... I have read a few report like this, but was unable to identify a specific pattern of events.

I have been using my system for four years, the problem occurs after my migrating onto FreeBSD month ago. Trying to change data cable will be the last done thing, when I lose all hopes.
Indeed, it would be a huge coincidence that the cable become problematic at the same time you installed FreeBSD, but please consider that you already knew about that, we can only know that after your post, and what acheron was suggesting is quite plausible and ultimately written with the intent to help.

It seem you have to continue your investigation, I would suggest a tool like "iostat":
open a terminal and run:
Code:
iostat 5
At the same time perform some activity, like opening a terminal, opening a browser ... and try to evaluate what happens ... specifically referred to disk/IO ... and simultaneus CPU load ... try to identify what could be the "bottleneck".
 

Sevendogs

Active Member

Thanks: 24
Messages: 168

#11
Not sure if this is helpful but chromium supposedly requires a kernel parameters tweak for shared memory:

Code:
    kern.ipc.shm_allow_removed=1
This would go in /etc/sysctl.conf. Not sure this is still required - I got that from a site showing how to set up a FreeBSD desktop, its about 2 years old.
 

themazay

New Member

Thanks: 4
Messages: 9

#12
Hi, Sevendogs!
I set this parameter after I have installed Chromium.
I am planing to find out settings needed to improve kernel and environment performence for desktop usage rether then server usage. If I dig out something, I will publish it here.
 

themazay

New Member

Thanks: 4
Messages: 9

#14
Hi all!
My problem disappeared.
I don't know what exactly fixed it. But here are all I have done:
Set my SSD:
# tunefs -p /dev/ada0s1
Code:
tunefs: soft updates: (-n)              enabled (disabled at first, but enabled now after some suggestions)
tunefs: soft update journaling: (-j)    disabled (was enabled)
tunefs: gjournal: (-J)                  disabled (was enabled)
tunefs: trim: (-t)                      enabled (was disabled)
For my ssd supports it:
camcontrol identify /dev/ada0
Code:
Data Set Management (DSM/TRIM) yes
Also I have replaced my Intel Smart Storage RAID with ZFS RAID at least. It was NTFS (remember, I came from Windows). Now all my storages are zfs. I used fusefs before to mount them.
And I moved my /tmp into RAM (tmpfs).
All this I have done 2-3 weeks ago, and now I do not notice any froze.
Yesterday I set
Code:
kern.sched.preempt_thresh=224
in sysctl.conf.
So if I will notice something like before - I post here.

Thank you, Sevendogs for a link in your last comment:
"If you want a great GTK-based desktop environment maintained by a team that doesn’t hate you, check out MATE, XFCE, or Cinnamon."
I will think about changing WM
 

fernandel

Aspiring Daemon

Thanks: 106
Messages: 558

#16
It is very helpful discussion... Thank you.
I have also sometimes problem when I am building ports (I am using Synth) and using Firefox on GNOME 3 which become frozen as themazay Chrome and I have
Code:
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6408
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)
Do you thing that is journaling the problem?
And my computer is a little old. I have FreeBSD installed on iMac 11,1
Code:
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: <ST31000528AS AP2E> ATA8-ACS SATA 2.x device
ada0: Serial Number 5VPDHMVH
ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada0: 953869MB (1953525168 512 byte sectors)
Trying to mount root from ufs:/dev/ada0p5 [rw]...
GEOM: ada0: enabling Boot Camp
ada0 at ata2 bus 0 scbus1 target 0 lun 0
ada0: <ST31000528AS AP2E> ATA8-ACS SATA 2.x device
ada0: Serial Number 5VPDHMVH
ada0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
ada0: 953869MB (1953525168 512 byte sectors)
Trying to mount root from ufs:/dev/ada0p5 [rw]...
GEOM: ada0: enabling Boot Camp
Thank you.
 
A

ASX

Guest


#17
Do you thing that is journaling the problem?
That's difficult to say without some analysis ... probably not.

However journaling can be turned off and eventually back on.
Consider also that turning off journaling can lead to long fsck time, not a problem in the case of themazay because she is running on an SSD disk.

Also, Synth can be resource hungry (depending on configuration and packages being build), if you are noticing bad performance only while running Synth the problem could be different and possibly solved using a different configuration.

By the way, better if you open your own thread and post additional info:
CPU, RAM, swap size / usage, Synth configuration ...
 

PacketMan

Aspiring Daemon

Thanks: 131
Messages: 854

#18
I have also sometimes problem when I am building ports (I am using Synth) and using Firefox on GNOME 3 which become frozen
My old slow poke machine does too when I try to run GNOME3 and Synth together. I simply tell the family the machine is in maintenance mode, and comment out all the 'gui' stuff until rebuilding is done.

# less /etc/rc.conf
Code:
#hald_enable="YES"
#dbus_enable="YES"
#gdm_enable="YES"
#gnome_enable="YES"
shutdown -r now, do your stuff, and when completed put the lines back into business and reboot again.

I've actually just started using another machine as a Synth package building machine, so this is getting to be moot for me but it does work, it does let your machine run it Synth jobs.
 

Oko

Daemon

Thanks: 754
Messages: 1,620

#19
Hi all!

Some time ago I decided to use FreeBSD as a workstation.
Before this I have been using MS Windows.
It was my dream to migrate to FreeBSD.
Now I am using FreeBSD. I chose Gnome 3 classic view as it is enough modern and beauty for me. But I am not so happy, as I expected, of it now.
My system became slow.
Let me stop you here. You are beating a dead horse. Gnome is quickly introducing many systemd dependencies. The situation is so bad that OpenBSD will most likely drop Gnome in the next release even though traditionally their port of Gnome was always better maintained than FreeBSD's with two full time developers which were actually Gnome developers too

http://undeadly.org/cgi?action=article&sid=20161109030623

Unlike OpenBSD, FreeBSD has not even start thinking about the world where systemd becomes "mandatory". OpenBSD is about to get a fake systemd interface which will enable you to use OpenBSD with many programs which expect systemd. I am not aware that anybody in FreeBSD camp is doing that probably due to the fact that most FreeBSD developers actually use MAC as their desktop OS.

My advise is to learn how to use a simple window manager or to go back to Linux.
 

fernandel

Aspiring Daemon

Thanks: 106
Messages: 558

#20
Oko
Everyone can use window manager which they want. I use CDE, Fluxbox but I use a lot of GNOME 3 which is very good IMO and working with Blender and GIMP under GNOME3 is fast and without problems. I cannot do under CDE the same. And what kind of computers/desktops FreeBSD developers use are there choice not miner or yours.
 

Oko

Daemon

Thanks: 754
Messages: 1,620

#21
Oko
Everyone can use window manager which they want. I use CDE, Fluxbox but I use a lot of GNOME 3 which is very good IMO and working with Blender and GIMP under GNOME3 is fast and without problems. I cannot do under CDE the same. And what kind of computers/desktops FreeBSD developers use are there choice not miner or yours.
I agree 100% with you. I am not criticizing anyone. I am just saying that GNOME has Linux as a requirement. Even if GNOME become sort of usable for OP now it will be soon-ish removed from the ports so there is no point in wasting the time on it if the guy is dead set on FreeBSD as a desktop OS.
 
Top