Skip to contentSkip to conversation

Logging

DISCUSSION Zenon Panoussis 3 participants 12 messages Apr 17, 2011 – Apr 19, 2011

lore
Share & tools
lore
#0 lore raw

Question: what's the "do not log at all" syntax in ceph.conf? I tried putting everything on "debug xyz = 0", but ceph (osd in this case) is still logging plenty. According to this, I think it shouldn't:

# grep debug /etc/ceph/ceph.conf
	; logging, for debugging monitor crashes, in order of
	debug ms = 0
	debug mon = 0
	debug paxos = 0
	debug auth = 0
	; mds logging to debug issues.
	debug ms = 0
	debug mds = 0
	debug mds balancer = 0
	debug mds log = 0
	debug mds_migrator = 0
	debug monc = 0
	; osd logging to debug osd issues, in order of likelihood of being
	debug ms = 0
	debug osd = 0
	debug filestore = 0
	debug journal = 0

Log example:

2011-04-18 01:28:56.787046 7f7976fd8700 osd0 5 pg[1.3d( v 5'186 (5'184,5'186] n=1 ec=2 les=5 3/3/2) [0,1] r=0 mlcod 5'184 active+clean]  sending commit on repgather(0x7f794827fb70 applying 5'186 rep_tid=49196 wfack=0 wfdisk= op=osd_op(mds0.1:27067 200.00000058 [write 3241176~1615] 1.fbbd) v2) 0x7f794811b630

Z

#1 lore raw
Quoted 4 lines · Zenon Panoussis

Question: what's the "do not log at all" syntax in ceph.conf? I tried putting everything on "debug xyz = 0", but ceph (osd in this case) is still logging plenty. According to this, I think it shouldn't:

Hi Zenon,

Messages that are output at log level 0 or -1 will always be displayed. I'm not sure if this message belongs at that log level or not-- I haven't dealt with the OSD repop code in a while.

In general, I don't think that anyone will ever want to turn off logging completely. That would be a little bit like running your server without syslog. It just doesn't happen in the real world. Also, Ceph is not stable yet, and logs are the main (only?) diagnostic tool we have for most problems. I guess sometimes there is a core file if you've set up your system for that.

That being said, we do need to be a lot less verbose in some places. If you find any log messages you think are mis-prioritized, patches are welcome!

Colin

Quoted 24 lines
# grep debug /etc/ceph/ceph.conf
       ; logging, for debugging monitor crashes, in order of
       debug ms = 0
       debug mon = 0
       debug paxos = 0
       debug auth = 0
       ; mds logging to debug issues.
       debug ms = 0
       debug mds = 0
       debug mds balancer = 0
       debug mds log = 0
       debug mds_migrator = 0
       debug monc = 0
       ; osd logging to debug osd issues, in order of likelihood of being
       debug ms = 0
       debug osd = 0
       debug filestore = 0
       debug journal = 0

Log example:

2011-04-18 01:28:56.787046 7f7976fd8700 osd0 5 pg[1.3d( v 5'186 (5'184,5'186] n=1 ec=2 les=5 3/3/2) [0,1] r=0 mlcod 5'184 active+clean]  sending commit on repgather(0x7f794827fb70 applying 5'186 rep_tid=49196 wfack=0 wfdisk= op=osd_op(mds0.1:27067 200.00000058 [write 3241176~1615] 1.fbbd) v2) 0x7f794811b630
Quoted 8 lines

Z

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

On 04/18/2011 02:53 AM, Colin McCabe wrote:

Hi

Quoted 7 lines
Quoted 3 lines

Question: what's the "do not log at all" syntax in ceph.conf? I tried putting everything on "debug xyz = 0", but ceph (osd in this case) is still logging plenty. According to this, I think it shouldn't:

Messages that are output at log level 0 or -1 will always be displayed. I'm not sure if this message belongs at that log level or not-- I haven't dealt with the OSD repop code in a while.

Wido mentioned "log file = " in a recent posting; I'll try it.

Quoted 3 lines

In general, I don't think that anyone will ever want to turn off logging completely. That would be a little bit like running your server without syslog. It just doesn't happen in the real world.

Of course you're right in general, but right now I'm trying to figure why my cluster is sluggy and logging is one potential cause that I'd like to test eliminating. I've seen something like this once before (in openldap), inexplicable slowness that I spent a long time trying to understand by reading logs, until I found out that it went away completely as soon as I switched off logging.

Z

#3 lore raw
Quoted 20 lines · Zenon Panoussis

On 04/18/2011 02:53 AM, Colin McCabe wrote:

Hi

Quoted 7 lines
Quoted 3 lines

Question: what's the "do not log at all" syntax in ceph.conf? I tried putting everything on "debug xyz = 0", but ceph (osd in this case) is still logging plenty. According to this, I think it shouldn't:

Messages that are output at log level 0 or -1 will always be displayed. I'm not sure if this message belongs at that log level or not-- I haven't dealt with the OSD repop code in a while.

Wido mentioned "log file = " in a recent posting; I'll try it.

Quoted 3 lines

In general, I don't think that anyone will ever want to turn off logging completely. That would be a little bit like running your server without syslog. It just doesn't happen in the real world.

Quoted 6 lines

Of course you're right in general, but right now I'm trying to figure why my cluster is sluggy and logging is one potential cause that I'd like to test eliminating. I've seen something like this once before (in openldap), inexplicable slowness that I spent a long time trying to understand by reading logs, until I found out that it went away completely as soon as I switched off logging.

Hi Zenon,

If you'd like to measure performance without logging, first set all the debug levels to 0. You should be able to do this, at least in head-of-line, with this:

debug mds = 0
debug mds balancer = 0
debug mds log = 0
debug mds log expire = 0
debug mds migrator = 0
debug filestore = 0
debug journal = 0
debug bdev = 0
debug mon = 0
debug auth = 0
debug finisher = 0

Then disable all the log sinks with this:

log file =
log to stderr = 0
log to syslog = false
clog to monitors = false
clog to syslog = false

cheers,
Colin

Quoted 8 lines

Z

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 5 lines · Colin McCabe

If you'd like to measure performance without logging, first set all the debug levels to 0. You should be able to do this, at least in head-of-line, with this:

Then disable all the log sinks with this:

Thanks, that's the part I was missing.

In the meanwhile I found a major bottleneck in my cluster, namely the fact that I had mounted the ext4 partitions that hold the stores with atime enabled. I should have thought of it earlier...

Z

#5 lore raw

I added "Mount the partition you are logging to using noatime" as a "tip" on http://ceph.newdream.net/wiki/Cluster_configuration

cheers,
Colin

Quoted 16 lines · Zenon Panoussis
Quoted 5 lines · Colin McCabe

If you'd like to measure performance without logging, first set all the debug levels to 0. You should be able to do this, at least in head-of-line, with this:

Then disable all the log sinks with this:

Thanks, that's the part I was missing.

In the meanwhile I found a major bottleneck in my cluster, namely the fact that I had mounted the ext4 partitions that hold the stores with atime enabled. I should have thought of it earlier...

Quoted 8 lines

Z

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 11 lines · Zenon Panoussis
Quoted 2 lines · Colin McCabe

I added "Mount the partition you are logging to using noatime" as a "tip" on http://ceph.newdream.net/wiki/Cluster_configuration

Aha, and I had put a word about noatime for the OSD partition in
http://ceph.newdream.net/wiki/Mounting_the_file_system . Obviously it doesn't make much of a difference on writes, but it makes a HUGE difference on reads.

Z

Oh yeah. mtime and ctime are the relevant things for writing (i.e. logging.) Well, I feel dumb now.

I'm sure there are other optimizations you could do for the logging partition.

I'm curious how much you saved by disabling logging. Also, how are you measuring performance?

sincerely,
Colin

Quoted 10 lines

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw
Quoted 1 line · Colin McCabe

I'm curious how much you saved by disabling logging.

To be honest, I have no idea.

Quoted 1 line

Also, how are you measuring performance?

My measuring is very primitive and un-scientific (which is why I couldn't answer your previous question). I have a two-node cluster with rule data { min_size 2 } and rule metadata { min_size 2 }. My ceph.conf says osd data = /mnt/osd and the latter is an ext4 partition of its own on each node. One monitor is running on one of the nodes and one client is running on my workstation.

So what I do is mount the monitor, run 'watch "df -m; echo; uptime"' on both nodes and start copying files to ceph with rsync. I have a news spool of just over a million small (1-3 KB) files which is perfect for the task. The rsync command is

rsync -vva --progress --bwlimit=N newsspool 127.0.0.1:/mnt/ceph/

where N is a number in KBps ranging from max 500 all the way down to 5. This gives me something like

===
Every 2.0s: df -m; echo; uptime Tue Apr 19 01:19:12 2011

Filesystem 1M-blocks Used Available Use% Mounted on
/dev/sda1 15019 3768 10489 27% /
tmpfs 993 0 993 0% /dev/shm

/dev/sda2                 7510      1342      5787  19% /var
/dev/sda5                15019      1777     12480  13% /var/log
/dev/mapper/sda6        232003      5571    213174   3% /mnt/osd

01:19:12 up 1 day, 2:25, 1 user, load average: 0.91, 1.12, 1.75
===

on each node and a fair idea of what the client is doing at the same time. The reason for using 127.0.0.1 as the target is that delta transfers and bwlimit do not apply to local tagets, so

rsync -vva --progress --bwlimit=N newsspool /mnt/ceph/

which in principle is equivalent, would just run full speed and re-copy everything that's not already on the target.

The load is the prime measure. When I see load 16 on a dual-CPU system, I know that things are getting out of hand before anything even breaks. Then I lower bwlimit and start again.

The relation between OSD partitions (/dev/mapper/sda6 in the example above) is another interesting factor. As long as the load is under 100%, the partitions on both nodes grow in almost perfect sync. When the load exceeds 100%, one node starts lagging behind the other. If that continues long enough, the lagging node falls out completely while the other node keeps growing. I've seen differences of almost 300% (11 GB on node02 and 4 GB on node01) which won't go away until a full ceph restart followed by a few hours of replaying patience.

Interestingly, the node with the monitor that actually receives the data (node01) is the one unable to write them to its own disk, while the other node (node02) grows way ahead. I'm not sure yet, but the likely cause of this is that the network speed of node01 and the disk speed of node02 both exceed the disk speed of node01. In any case, a load above 100% is not a reason for concern all and by itself, but the node storages growing out of sync is. If that goes far enough, the nodes are unable to synchronise again without an unmount and full restart of ceph and in the worst case scenario the data is corrupted.

Now, having run rsync for a while, I kill it and start it again. This will cause it to compare all files that are already on the target, skip those that have identical size and near-identical mtime, and only copy files that are either missing or different. Assuming for example that I successfully copied 200.000 files in the first run, the second run will compare 200.000 files and start copying again from the 200.001:st file on.

This is where I could really see the difference between atime and noatime on the OSD underlying partition. bwlimit is meaningless on size and mtime reads, so the client would read file attributes at full blast. With atime on the underlying partition this caused the nodes to jump to loads of 5 or more. With noatime, they displayed a load of 0.1 or so and the whole compare opration completed in a small fraction of the time previously required.

Z

#9 lore raw
Quoted 8 lines · Zenon Panoussis

The relation between OSD partitions (/dev/mapper/sda6 in the example above) is another interesting factor. As long as the load is under 100%, the partitions on both nodes grow in almost perfect sync. When the load exceeds 100%, one node starts lagging behind the other. If that continues long enough, the lagging node falls out completely while the other node keeps growing. I've seen differences of almost 300% (11 GB on node02 and 4 GB on node01) which won't go away until a full ceph restart followed by a few hours of replaying patience.

This is really interesting. This is on the partitions that have _just_ the OSD data? Do you see any OSD flapping (down/up cycles) during this period?

It's possible that the MDS is getting ahead of the OSDs, as there isn't currently any throttling of metadata request processing when the journaling is slow. (We should fix this.) I don't see how that would explain the variance in disk usage, though, unless you are also seeing the difference in disk usage reflected in the cosd memory usage on the less-disk-used node?

Quoted 9 lines

Interestingly, the node with the monitor that actually receives the data (node01) is the one unable to write them to its own disk, while the other node (node02) grows way ahead. I'm not sure yet, but the likely cause of this is that the network speed of node01 and the disk speed of node02 both exceed the disk speed of node01. In any case, a load above 100% is not a reason for concern all and by itself, but the node storages growing out of sync is. If that goes far enough, the nodes are unable to synchronise again without an unmount and full restart of ceph and in the worst case scenario the data is corrupted.

I don't think it is the monitors, although you could verify that with a du on the mon data directory on the two nodes.

In any case, none of these things should be corrupting data... :/

Quoted 7 lines

Now, having run rsync for a while, I kill it and start it again. This will cause it to compare all files that are already on the target, skip those that have identical size and near-identical mtime, and only copy files that are either missing or different. Assuming for example that I successfully copied 200.000 files in the first run, the second run will compare 200.000 files and start copying again from the 200.001:st file on.

Quoted 6 lines

This is where I could really see the difference between atime and noatime on the OSD underlying partition. bwlimit is meaningless on size and mtime reads, so the client would read file attributes at full blast. With atime on the underlying partition this caused the nodes to jump to loads of 5 or more. With noatime, they displayed a load of 0.1 or so and the whole compare opration completed in a small fraction of the time previously required.

This is good to keep in mind. If the 'btrfs devs' option is defined and the init script mounts the data volume for you, the default 'btrfs opts' mount options include noatime. Anyone overriding that or mounting the osd data themselves would be wise to keep noatime in the option set.

sage

#10 lore raw
Quoted 8 lines · Sage Weil
Quoted 5 lines

The relation between OSD partitions (/dev/mapper/sda6 in the example above) is another interesting factor. As long as the load is under 100%, the partitions on both nodes grow in almost perfect sync. When the load exceeds 100%, one node starts lagging behind the other. If that continues long enough, the lagging node falls out completely while the other node keeps growing.

This is really interesting. This is on the partitions that have _just_ the OSD data?

Yes, with a couple of extra layers. node01 keeps its OSD data on an ext4 filesystem on top of a dm-crypt encrypted native disk partition. node02 on the other hand has an mdadm RAID0 of two partitions on separate disks with dm-crypt and ext4 on top of that. This layering - in particular the encryption - consumes CPU and can slow down things, but for the rest it's rock-solid; I've been running systems with these setups for years and never had a problem with them even once.

Here's an example from this morning:

node01:
/dev/mapper/sda6 232003 5914 212830 3% /mnt/osd

node02:
/dev/mapper/md4 225716 5704 207112 3% /mnt/osd

client:
192.168.178.100:6789:/

                        232002      5913    212829   3% /mnt/n01

You can see that the total space on the client corresponds to that of node01, so the osd of node02 has gone belly up. The load on node01 is creeping upwards of 200% while rsync on the client keeps smiling and pushing data.

node01 top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

24793 root      20   0 1679m 510m 1756 S  9.2 25.7  29:23.11 cosd
30235 root      20   0     0    0    0 S  1.0  0.0   0:01.10 kworker/0:1
  637 root      20   0     0    0    0 S  0.7  0.0   4:56.26 jbd2/sda2-8
30468 root      20   0 14988 1152  864 R  0.7  0.1   0:00.14 top
21748 root      20   0  104m  796  504 S  0.3  0.0   1:04.27 watch
29418 root      20   0     0    0    0 S  0.3  0.0   0:02.12 kworker/0:2

node01 iotop:

  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
24933 be/4 root      109.97 K/s    7.12 K/s  0.00 % 95.49 % cosd -i 0 -c ~ceph/ceph.conf
24934 be/4 root       94.15 K/s    7.12 K/s  0.00 % 92.45 % cosd -i 0 -c ~ceph/ceph.conf
24830 be/4 root        0.00 B/s   36.39 K/s  0.00 % 81.10 % cosd -i 0 -c ~ceph/ceph.conf
  637 be/3 root        0.00 B/s    0.00 B/s  0.00 % 80.27 % [jbd2/sda2-8]
  256 be/3 root        0.00 B/s    2.37 K/s  0.00 % 72.93 % [jbd2/sda1-8]
24831 be/4 root        0.00 B/s    0.00 B/s  0.00 % 27.85 % cosd -i 0 -c ~ceph/ceph.conf
24826 be/4 root        0.00 B/s  272.94 K/s  0.00 % 19.28 % cosd -i 0 -c ~ceph/ceph.conf
24829 be/4 root        0.00 B/s   45.89 K/s  0.00 % 18.03 % cosd -i 0 -c ~ceph/ceph.conf
24632 be/4 root        0.00 B/s   26.90 K/s  0.00 %  5.99 % cmon -i 0 -c ~ceph/ceph.conf
24556 be/3 root        0.00 B/s    5.54 K/s  0.00 %  2.95 % [jbd2/dm-0-8]
  639 be/3 root        0.00 B/s    0.00 B/s  0.00 %  2.32 % [jbd2/sda5-8]
24833 be/4 root        0.00 B/s   10.28 K/s  0.00 %  0.00 % cosd -i 0 -c ~ceph/ceph.conf

At this point I unmounted ceph on the client and restarted ceph. A few minutes later I see this:

node01:
/dev/mapper/sda6 232003 5907 212837 3% /mnt/osd

node02:
/dev/mapper/md4 225716 5626 207190 3% /mnt/osd

Note how disk usage went down on both nodes, considerably on node02.

Then they start exchanging data and an hour later or so they're back in sync:

node01:
/dev/mapper/sda6 232003 5906 212838 3% /mnt/osd

node02:
/dev/mapper/md4 225716 5906 206910 3% /mnt/osd

Quoted 2 lines

Do you see any OSD flapping (down/up cycles) during this period?

I've been running without logs since yesterday, but my experience is that they don't flap; once an OSD goes down it stays down until ceph is restarted.

Quoted 6 lines

It's possible that the MDS is getting ahead of the OSDs, as there isn't currently any throttling of metadata request processing when the journaling is slow. (We should fix this.) I don't see how that would explain the variance in disk usage, though, unless you are also seeing the difference in disk usage reflected in the cosd memory usage on the less-disk-used node?

I didn't pay attention to memory usage, but I think I can rule this out anyway. node01 has 2 GB RAM and 2 GB swap, node02 has 4 GB RAM and no swap. Since I saw 11 GB on the node02 OSD the other day and 4 GB on the node01 OSD, the difference could not have been in memory.

Z

#11 lore raw
Quoted 16 lines
Quoted 2 lines

This is really interesting. This is on the partitions that have _just_ the OSD data?

Yes, with a couple of extra layers. node01 keeps its OSD data on an ext4 filesystem on top of a dm-crypt encrypted native disk partition. node02 on the other hand has an mdadm RAID0 of two partitions on separate disks with dm-crypt and ext4 on top of that. This layering - in particular the encryption - consumes CPU and can slow down things, but for the rest it's rock-solid; I've been running systems with these setups for years and never had a problem with them even once.

Here's an example from this morning:

node01:
/dev/mapper/sda6 232003 5914 212830 3% /mnt/osd

Quoted 6 lines

node02:
/dev/mapper/md4 225716 5704 207112 3% /mnt/osd

client:
192.168.178.100:6789:/

                        232002      5913    212829   3% /mnt/n01

Oh... I suspect that only one of the OSDs is active. The ceph client's df/statfs result is really just a sum over the statfs results on all of the OSDs. The fact that is corresponds to node01 suggests that node02 isn't part of the cluster. Can you post the output from

ceph osd dump -o -

Quoted 11 lines

At this point I unmounted ceph on the client and restarted ceph. A few minutes later I see this:

node01:
/dev/mapper/sda6 232003 5907 212837 3% /mnt/osd

node02:
/dev/mapper/md4 225716 5626 207190 3% /mnt/osd

Note how disk usage went down on both nodes, considerably on node02.

Quoted 7 lines

Then they start exchanging data and an hour later or so they're back in sync:

node01:
/dev/mapper/sda6 232003 5906 212838 3% /mnt/osd

node02:
/dev/mapper/md4 225716 5906 206910 3% /mnt/osd

I wouldn't read into the disk utilizations too closely. There is logging going on at a couple of different levels that can make the utilization fluctuate depending on the timing of trimming.

Quoted 5 lines
Quoted 2 lines

Do you see any OSD flapping (down/up cycles) during this period?

I've been running without logs since yesterday, but my experience is that they don't flap; once an OSD goes down it stays down until ceph is restarted.

Also, one thing you should do during these tests is keep a

ceph -w

running to monitor changes in the cluster state (to see, for example, if it's marking either osd down).

Thanks!
sage