You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Johannes Weißl <ja...@molb.org> on 2022/06/01 11:24:57 UTC

Slow unit tests with Cassandra 4.x on macOS

Hello,

We noticed that our unit tests are way slower on macOS after the upgrade
from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds (!).
On Linux the duration stays more or less the same.

After debugging, we found that operations like "DROP KEYSPACE" seem
responsible for the increase. Also interesting: If Cassandra is started
via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.

Is this a known phenomenon? Do others experience it as well?

Thanks,
Johannes

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Johannes Weißl <ja...@molb.org>.
Hi Jacek,

Sorry for the late respone! We still have the issue. The call to InetAddress.getLocalHost() is very fast on both Linux and macOS.

I have attached the example program "test_slow_cassandra_drop.sh". Example results for me (do not deviate much between runs):

===> With Cassandra 4.0.4 on Darwin x86_64 creating 30 keyspaces takes 6 seconds, dropping 30 keyspaces takes 62 seconds.
===> With Cassandra 4.0.4 on Darwin arm64 creating 30 keyspaces takes 5 seconds, dropping 30 keyspaces takes 49 seconds.
===> With Cassandra 4.0.4 on Linux x86_64 creating 30 keyspaces takes 2 seconds, dropping 30 keyspaces takes 2 seconds.

With Cassandra 3.11.x macOS and Linux were pretty similar. I have the suspicion it might have something to do with the Apple File System, because, as mentioned below, when Cassandra is started via Docker on macOS, dropping keyspaces is very fast.

Thanks for your help!

Johannes

On Wed, Jun 22, 2022 at 09:52AM +0200, Jacek Lewandowski wrote:
> Hi Johannes,
> 
> Have you already managed to fix the issue? If not, one thing that comes to my mind given you said it works fast on Linux and slow on Mac, is that you may
> have misconfigured hostname in your system. A simple test would be to just measure the time you need to call:
> 
> InetAddress.getLocalHost()
> 
> If this is not the case, please share some small reproduction example, I'll try to figure it out
> 
> Thanks,
> - - -- --- ----- -------- -------------
> Jacek Lewandowski
> 
> 
> On Thu, Jun 9, 2022 at 8:49 PM Johannes Weißl <ja...@molb.org> wrote:
> 
>     Hi Jacek,
> 
>     The unit tests are from the company I work at, so I cannot share any
>     link. They repeatedly create and drop schemas as part of the unit test
>     setup and teardown methods.
> 
>     If it helps, I can provide minimal executable examples, but I thought
>     maybe the problem is already known (after all, I guess some Cassandra
>     developers are using macOS)?
> 
>     Johannes
> 
>     On Thu, Jun 02, 2022 at 08:56AM +0200, Jacek Lewandowski wrote:
>     > Which tests exactly?
>     >
>     > - - -- --- ----- -------- -------------
>     > Jacek Lewandowski
>     >
>     > On Thu, Jun 2, 2022 at 8:39 AM Erick Ramirez <er...@apache.org> wrote:
>     > > Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!
>     > >
>     > > On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:
>     > > > Hello,
>     > > >
>     > > > We noticed that our unit tests are way slower on macOS after the upgrade
>     > > > from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds (!).
>     > > > On Linux the duration stays more or less the same.
>     > > >
>     > > > After debugging, we found that operations like "DROP KEYSPACE" seem
>     > > > responsible for the increase. Also interesting: If Cassandra is started
>     > > > via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
>     > > >
>     > > > Is this a known phenomenon? Do others experience it as well?
>     > > >
>     > > > Thanks,
>     > > > Johannes
> 

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Jacek Lewandowski <le...@gmail.com>.
Hi Johannes,

Have you already managed to fix the issue? If not, one thing that comes to
my mind given you said it works fast on Linux and slow on Mac, is that you
may have misconfigured hostname in your system. A simple test would be to
just measure the time you need to call:

InetAddress.getLocalHost()

If this is not the case, please share some small reproduction example, I'll
try to figure it out

Thanks,
- - -- --- ----- -------- -------------
Jacek Lewandowski


On Thu, Jun 9, 2022 at 8:49 PM Johannes Weißl <ja...@molb.org> wrote:

> Hi Jacek,
>
> The unit tests are from the company I work at, so I cannot share any
> link. They repeatedly create and drop schemas as part of the unit test
> setup and teardown methods.
>
> If it helps, I can provide minimal executable examples, but I thought
> maybe the problem is already known (after all, I guess some Cassandra
> developers are using macOS)?
>
> Johannes
>
> On Thu, Jun 02, 2022 at 08:56AM +0200, Jacek Lewandowski wrote:
> > Which tests exactly?
> >
> > - - -- --- ----- -------- -------------
> > Jacek Lewandowski
> >
> > On Thu, Jun 2, 2022 at 8:39 AM Erick Ramirez <er...@apache.org>
> wrote:
> > > Johannes, I've copied the Dev ML to hopefully get a wider audience.
> Cheers!
> > >
> > > On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:
> > > > Hello,
> > > >
> > > > We noticed that our unit tests are way slower on macOS after the
> upgrade
> > > > from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30
> seconds (!).
> > > > On Linux the duration stays more or less the same.
> > > >
> > > > After debugging, we found that operations like "DROP KEYSPACE" seem
> > > > responsible for the increase. Also interesting: If Cassandra is
> started
> > > > via Docker on macOS, the tests run as fast as on Cassandra 3.11.x
> again.
> > > >
> > > > Is this a known phenomenon? Do others experience it as well?
> > > >
> > > > Thanks,
> > > > Johannes
>

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Johannes Weißl <ja...@molb.org>.
Hi Jacek,

The unit tests are from the company I work at, so I cannot share any
link. They repeatedly create and drop schemas as part of the unit test
setup and teardown methods.

If it helps, I can provide minimal executable examples, but I thought
maybe the problem is already known (after all, I guess some Cassandra
developers are using macOS)?

Johannes

On Thu, Jun 02, 2022 at 08:56AM +0200, Jacek Lewandowski wrote:
> Which tests exactly?
> 
> - - -- --- ----- -------- -------------
> Jacek Lewandowski
> 
> On Thu, Jun 2, 2022 at 8:39 AM Erick Ramirez <er...@apache.org> wrote:
> > Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!
> > 
> > On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:
> > > Hello,
> > >
> > > We noticed that our unit tests are way slower on macOS after the upgrade
> > > from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds (!).
> > > On Linux the duration stays more or less the same.
> > > 
> > > After debugging, we found that operations like "DROP KEYSPACE" seem
> > > responsible for the increase. Also interesting: If Cassandra is started
> > > via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
> > > 
> > > Is this a known phenomenon? Do others experience it as well?
> > > 
> > > Thanks,
> > > Johannes

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Johannes Weißl <ja...@molb.org>.
Hi Jacek,

The unit tests are from the company I work at, so I cannot share any
link. They repeatedly create and drop schemas as part of the unit test
setup and teardown methods.

If it helps, I can provide minimal executable examples, but I thought
maybe the problem is already known (after all, I guess some Cassandra
developers are using macOS)?

Johannes

On Thu, Jun 02, 2022 at 08:56AM +0200, Jacek Lewandowski wrote:
> Which tests exactly?
> 
> - - -- --- ----- -------- -------------
> Jacek Lewandowski
> 
> On Thu, Jun 2, 2022 at 8:39 AM Erick Ramirez <er...@apache.org> wrote:
> > Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!
> > 
> > On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:
> > > Hello,
> > >
> > > We noticed that our unit tests are way slower on macOS after the upgrade
> > > from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds (!).
> > > On Linux the duration stays more or less the same.
> > > 
> > > After debugging, we found that operations like "DROP KEYSPACE" seem
> > > responsible for the increase. Also interesting: If Cassandra is started
> > > via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
> > > 
> > > Is this a known phenomenon? Do others experience it as well?
> > > 
> > > Thanks,
> > > Johannes

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Jacek Lewandowski <le...@gmail.com>.
Which tests exactly?

- - -- --- ----- -------- -------------
Jacek Lewandowski


On Thu, Jun 2, 2022 at 8:39 AM Erick Ramirez <er...@apache.org>
wrote:

> Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!
>
> On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:
>
>> Hello,
>>
>> We noticed that our unit tests are way slower on macOS after the upgrade
>> from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds
>> (!).
>> On Linux the duration stays more or less the same.
>>
>> After debugging, we found that operations like "DROP KEYSPACE" seem
>> responsible for the increase. Also interesting: If Cassandra is started
>> via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
>>
>> Is this a known phenomenon? Do others experience it as well?
>>
>> Thanks,
>> Johannes
>>
>

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Erick Ramirez <er...@apache.org>.
Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!

On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:

> Hello,
>
> We noticed that our unit tests are way slower on macOS after the upgrade
> from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds
> (!).
> On Linux the duration stays more or less the same.
>
> After debugging, we found that operations like "DROP KEYSPACE" seem
> responsible for the increase. Also interesting: If Cassandra is started
> via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
>
> Is this a known phenomenon? Do others experience it as well?
>
> Thanks,
> Johannes
>

Re: Slow unit tests with Cassandra 4.x on macOS

Posted by Erick Ramirez <er...@apache.org>.
Johannes, I've copied the Dev ML to hopefully get a wider audience. Cheers!

On Wed, 1 Jun 2022 at 21:25, Johannes Weißl <ja...@molb.org> wrote:

> Hello,
>
> We noticed that our unit tests are way slower on macOS after the upgrade
> from Cassandra 3.11.x to 4.x, e.g. over 8 minutes instead of 30 seconds
> (!).
> On Linux the duration stays more or less the same.
>
> After debugging, we found that operations like "DROP KEYSPACE" seem
> responsible for the increase. Also interesting: If Cassandra is started
> via Docker on macOS, the tests run as fast as on Cassandra 3.11.x again.
>
> Is this a known phenomenon? Do others experience it as well?
>
> Thanks,
> Johannes
>