---------- Forwarded message ----------
From: Vinod Kone <[email protected]>
Date: Wed, Jul 10, 2013 at 12:46 PM
Subject: Re: Disk space in UI on EC2 instances
To: dev <[email protected]>


Yea, the bug exists in 0.12.0. This was fixed in 0.13.0. You could either
run 0.13.0-rc2
<https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=commit;h=09f4c11b820124a42c18d52ce80ad0e1fc5abc82>(not
yet released but it is tagged) to get the fix or just manually apply the
tiny patch below. Note that the below patch assumes slave work directory
exists before the slave is started (which is also a bug that was fixed in
0.14.0).


Author: Vinod Kone <[email protected]>
Date:   Fri Apr 26 19:05:37 2013 +0000

    Fixed the slave to do disk usage calculations on the filesystem on
    which the slave work directory is mounted.

    Review: https://reviews.apache.org/r/10661

    git-svn-id:
https://svn.apache.org/repos/asf/incubator/mesos/trunk@147634513f79535-47bb-0310-9956-ffa450edef68

diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 749c958..86a15fc 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -151,7 +151,9 @@ Slave::Slave(const slave::Flags& _flags,
   if (resources.disk().isSome()) {
     disk = resources.disk().get();
   } else {
-    Try<uint64_t> disk_ = fs::available(); // in bytes.
+    // NOTE: We calculate disk availability of the file system on
+    // which the slave work directory is mounted.
+    Try<uint64_t> disk_ = fs::available(flags.work_dir); // in bytes.
     if (!disk_.isSome()) {
       LOG(WARNING) << "Failed to auto-detect the free disk space,"
                    << " defaulting to " << DEFAULT_DISK  << " MB";
@@ -2459,7 +2461,9 @@ void Slave::checkDiskUsage()
 {
   // TODO(vinod): We are making usage a Future, so that we can plug in
   // fs::usage() into async.
-  Future<Try<double> >(fs::usage())
+  // NOTE: We calculate disk usage of the file system on which the
+  // slave work directory is mounted.
+  Future<Try<double> >(fs::usage(flags.work_dir))
     .onAny(defer(self(), &Slave::_checkDiskUsage, params::_1));
 }



@vinodkone


On Wed, Jul 10, 2013 at 12:30 PM, Gary Malouf <[email protected]> wrote:

> I am running mesos-0.12.0-incubating.  Does the bug affect that one as
> well?
>
>
> On Wed, Jul 10, 2013 at 2:38 PM, Gary Malouf <[email protected]>
> wrote:
>
> > Also relevant (copied from UI):
> >
> > Active Slaves (see all <http://localhost:5050/#/slaves>)   ID<
> http://localhost:5050/#/>
> > Host <http://localhost:5050/#/>  CPUs <http://localhost:5050/#/>  Mem<
> http://localhost:5050/#/>
> > Disk <http://localhost:5050/#/>  Registered <http://localhost:5050/#/>
>   …3744-1
> > <http://localhost:5050/#/>  mesos-test-02
> > <http://localhost:5050/#/slaves/201307092108-1315739402-5050-3744-1> 1 3
> > GB 1 GB  21 hours ago <http://localhost:5050/#/>   …3744-0
> > <http://localhost:5050/#/>  mesos-test-01
> > <http://localhost:5050/#/slaves/201307092108-1315739402-5050-3744-0> 1 3
> > GB 1 GB  21 hours ago <http://localhost:5050/#/>
> >
> >
> > On Wed, Jul 10, 2013 at 2:36 PM, Gary Malouf <[email protected]
> >wrote:
> >
> >> It says it is taking up 65% of the available disk space.  This is
> strange
> >> since I have the work directory (/tmp/mesos) symlinked to an instance
> >> volume that has almost 150GB free.
> >>
> >> I've put the relative terminal output below - I think the strong
> >> preference would be for mesos to sensibly detect the stuff rather than
> it
> >> be explicitly enumerated in configuration.
> >>
> >> slave.cpp:1233] Current disk usage 64.76%. Max allowed age: 2.47days
> >>
> >> [root@mesos-test-02 log]# du -hcs /media/ephemeral0/
> >> 13M    /media/ephemeral0/
> >> 13M    total
> >>
> >> [root@mesos-test-02 log]# df -h
> >> Filesystem            Size  Used Avail Use% Mounted on
> >> /dev/xvde1            5.0G  3.2G  1.5G  69% /
> >> tmpfs                 1.8G     0  1.8G   0% /dev/shm
> >> /dev/xvdf             394G  211M  374G   1% /media/ephemeral0
> >>
> >> [root@mesos-test-02 tmp]# ls -la
> >> total 232
> >> drwxrwxrwt.  4 root root   4096 Jul 10 18:33 .
> >> dr-xr-xr-x. 22 root root   4096 Jul  9 16:49 ..
> >> -rw-r--r--   1 root root 217689 Jul  9 21:58 chronos-1.log
> >> drwxr-xr-x   2 root root   4096 Jul 10 01:03 hsperfdata_root
> >> drwxrwxrwt   2 root root   4096 Jul  9 15:46 .ICE-unix
> >> lrwxrwxrwx   1 root root     38 Jul  9 20:03 mesos ->
> >> /media/ephemeral0/var/log/mesos-slaves
> >>
> >>
> >> Thanks,
> >>
> >> Gary
> >>
> >>
> >>
> >>
> >> On Tue, Jul 9, 2013 at 4:11 PM, Gary Malouf <[email protected]
> >wrote:
> >>
> >>> Hi everyone,
> >>>
> >>> I have Mesos running with Chronos.  The UI shows the disk space being
> >>> very low (1GB), but I have the log and slave work directories
> symlinked to
> >>> locations on a disk with 374GB of free space.  How does the Mesos ui
> >>> determine disk space?
> >>>
> >>> -Gary
> >>>
> >>
> >>
> >
>

Reply via email to