Re: Logging queries

2017-02-18 Thread Igor Leão
Thanks Bhuvan!

Matija, I'm looking forward to this new release. Cassandra-diagnostics is
just great and this feature will make it awesome.
Hope to hear from you soon.

2017-02-18 17:20 GMT-03:00 Bhuvan Rawal :

> Im not sure if you can create an index on system_traces keyspace for this
> use case.
>
> If the performance issue that you are trying to troubleshoot is consistent
> than you can switch on tracing for a while and do dump of
> system_traces.events table say using COPY into csv. You can do analysis on
> that for finding the problematic query.
>
> copy system_traces.events TO 'traces_dump.csv';
>
> Also do make sure you dont set trace probability to a high number if
> working on a production database as it can adversely impact performance.
>
> Regards,
>
> On Sun, Feb 19, 2017 at 1:28 AM, Igor Leão  wrote:
>
>> Hi Bhuvan,
>> Thanks a lot!
>>
>> Any idea if something can be done for C* 2.X?
>>
>> Best,
>> Igor
>>
>> 2017-02-18 16:41 GMT-03:00 Bhuvan Rawal :
>>
>>> Hi Igor,
>>>
>>> If you are using java driver, you can log slow queries on client side
>>> using QueryLogger.
>>> https://docs.datastax.com/en/developer/java-driver/2.1/manual/logging/
>>>
>>> Slow Query logger for server was introduced in C* 3.10 version. Details:
>>> https://issues.apache.org/jira/browse/CASSANDRA-12403
>>>
>>> Regards,
>>> Bhuvan
>>>
>>> On Sun, Feb 19, 2017 at 12:59 AM, Igor Leão  wrote:
>>>
 Hi there,

 I'm wondering how to log queries from Cassandra. These queries can be
 either slow queries or all queries. The only constraint is that I should do
 this on server side.

 I tried using `nodetool settraceprobability`, which writes all queries
 to the keyspace `system_traces`. When I try to see which queries are slower
 than a given number, I get:

 Result: ```InvalidRequest: code=2200 [Invalid query] message="No
 secondary indexes on the restricted columns support the provided operators:
 "```
 Query: `select * from events where source_elapsed >= 1000;`

 My goal is to debug performance issues in a production database. I want
 to know which queries are degrading the performance of the db.

 Thanks in advance!







>>>
>>
>>
>> --
>> Igor Leão  Site Reliability Engineer
>>
>> Mobile: +55 81 99727-1083 
>> Skype: *igorvpcleao*
>> Office: +55 81 4042-9757 
>> Website: inlocomedia.com 
>> [image: inlocomedia]
>> 
>>  [image: LinkedIn]
>> 
>>  [image: Facebook]  [image:
>> Twitter]
>> 
>>
>>
>>
>>
>>
>>
>>
>


-- 
Igor Leão  Site Reliability Engineer

Mobile: +55 81 99727-1083 
Skype: *igorvpcleao*
Office: +55 81 4042-9757 
Website: inlocomedia.com 
[image: inlocomedia]

 [image: LinkedIn]

 [image: Facebook]  [image: Twitter]



Re: Logging queries

2017-02-18 Thread Bhuvan Rawal
Im not sure if you can create an index on system_traces keyspace for this
use case.

If the performance issue that you are trying to troubleshoot is consistent
than you can switch on tracing for a while and do dump of
system_traces.events table say using COPY into csv. You can do analysis on
that for finding the problematic query.

copy system_traces.events TO 'traces_dump.csv';

Also do make sure you dont set trace probability to a high number if
working on a production database as it can adversely impact performance.

Regards,

On Sun, Feb 19, 2017 at 1:28 AM, Igor Leão  wrote:

> Hi Bhuvan,
> Thanks a lot!
>
> Any idea if something can be done for C* 2.X?
>
> Best,
> Igor
>
> 2017-02-18 16:41 GMT-03:00 Bhuvan Rawal :
>
>> Hi Igor,
>>
>> If you are using java driver, you can log slow queries on client side
>> using QueryLogger.
>> https://docs.datastax.com/en/developer/java-driver/2.1/manual/logging/
>>
>> Slow Query logger for server was introduced in C* 3.10 version. Details:
>> https://issues.apache.org/jira/browse/CASSANDRA-12403
>>
>> Regards,
>> Bhuvan
>>
>> On Sun, Feb 19, 2017 at 12:59 AM, Igor Leão  wrote:
>>
>>> Hi there,
>>>
>>> I'm wondering how to log queries from Cassandra. These queries can be
>>> either slow queries or all queries. The only constraint is that I should do
>>> this on server side.
>>>
>>> I tried using `nodetool settraceprobability`, which writes all queries
>>> to the keyspace `system_traces`. When I try to see which queries are slower
>>> than a given number, I get:
>>>
>>> Result: ```InvalidRequest: code=2200 [Invalid query] message="No
>>> secondary indexes on the restricted columns support the provided operators:
>>> "```
>>> Query: `select * from events where source_elapsed >= 1000;`
>>>
>>> My goal is to debug performance issues in a production database. I want
>>> to know which queries are degrading the performance of the db.
>>>
>>> Thanks in advance!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
>
> --
> Igor Leão  Site Reliability Engineer
>
> Mobile: +55 81 99727-1083 
> Skype: *igorvpcleao*
> Office: +55 81 4042-9757 
> Website: inlocomedia.com 
> [image: inlocomedia]
> 
>  [image: LinkedIn]
> 
>  [image: Facebook]  [image: Twitter]
> 
>
>
>
>
>
>
>


Re: Logging queries

2017-02-18 Thread Matija Gobec
Hi Igor,

Your best bet is to wait for our next release of diagnostics
 for 2.x branch. We
are planning it for next week.

Best,
Matija

On Sat, Feb 18, 2017 at 8:58 PM, Igor Leão  wrote:

> Hi Bhuvan,
> Thanks a lot!
>
> Any idea if something can be done for C* 2.X?
>
> Best,
> Igor
>
> 2017-02-18 16:41 GMT-03:00 Bhuvan Rawal :
>
>> Hi Igor,
>>
>> If you are using java driver, you can log slow queries on client side
>> using QueryLogger.
>> https://docs.datastax.com/en/developer/java-driver/2.1/manual/logging/
>>
>> Slow Query logger for server was introduced in C* 3.10 version. Details:
>> https://issues.apache.org/jira/browse/CASSANDRA-12403
>>
>> Regards,
>> Bhuvan
>>
>> On Sun, Feb 19, 2017 at 12:59 AM, Igor Leão  wrote:
>>
>>> Hi there,
>>>
>>> I'm wondering how to log queries from Cassandra. These queries can be
>>> either slow queries or all queries. The only constraint is that I should do
>>> this on server side.
>>>
>>> I tried using `nodetool settraceprobability`, which writes all queries
>>> to the keyspace `system_traces`. When I try to see which queries are slower
>>> than a given number, I get:
>>>
>>> Result: ```InvalidRequest: code=2200 [Invalid query] message="No
>>> secondary indexes on the restricted columns support the provided operators:
>>> "```
>>> Query: `select * from events where source_elapsed >= 1000;`
>>>
>>> My goal is to debug performance issues in a production database. I want
>>> to know which queries are degrading the performance of the db.
>>>
>>> Thanks in advance!
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
>
> --
> Igor Leão  Site Reliability Engineer
>
> Mobile: +55 81 99727-1083 
> Skype: *igorvpcleao*
> Office: +55 81 4042-9757 
> Website: inlocomedia.com 
> [image: inlocomedia]
> 
>  [image: LinkedIn]
> 
>  [image: Facebook]  [image: Twitter]
> 
>
>
>
>
>
>
>


Re: Logging queries

2017-02-18 Thread Igor Leão
Hi Bhuvan,
Thanks a lot!

Any idea if something can be done for C* 2.X?

Best,
Igor

2017-02-18 16:41 GMT-03:00 Bhuvan Rawal :

> Hi Igor,
>
> If you are using java driver, you can log slow queries on client side
> using QueryLogger.
> https://docs.datastax.com/en/developer/java-driver/2.1/manual/logging/
>
> Slow Query logger for server was introduced in C* 3.10 version. Details:
> https://issues.apache.org/jira/browse/CASSANDRA-12403
>
> Regards,
> Bhuvan
>
> On Sun, Feb 19, 2017 at 12:59 AM, Igor Leão  wrote:
>
>> Hi there,
>>
>> I'm wondering how to log queries from Cassandra. These queries can be
>> either slow queries or all queries. The only constraint is that I should do
>> this on server side.
>>
>> I tried using `nodetool settraceprobability`, which writes all queries to
>> the keyspace `system_traces`. When I try to see which queries are slower
>> than a given number, I get:
>>
>> Result: ```InvalidRequest: code=2200 [Invalid query] message="No
>> secondary indexes on the restricted columns support the provided operators:
>> "```
>> Query: `select * from events where source_elapsed >= 1000;`
>>
>> My goal is to debug performance issues in a production database. I want
>> to know which queries are degrading the performance of the db.
>>
>> Thanks in advance!
>>
>>
>>
>>
>>
>>
>>
>


-- 
Igor Leão  Site Reliability Engineer

Mobile: +55 81 99727-1083 
Skype: *igorvpcleao*
Office: +55 81 4042-9757 
Website: inlocomedia.com 
[image: inlocomedia]

 [image: LinkedIn]

 [image: Facebook]  [image: Twitter]



Re: Logging queries

2017-02-18 Thread Bhuvan Rawal
Hi Igor,

If you are using java driver, you can log slow queries on client side using
QueryLogger.
https://docs.datastax.com/en/developer/java-driver/2.1/manual/logging/

Slow Query logger for server was introduced in C* 3.10 version. Details:
https://issues.apache.org/jira/browse/CASSANDRA-12403

Regards,
Bhuvan

On Sun, Feb 19, 2017 at 12:59 AM, Igor Leão  wrote:

> Hi there,
>
> I'm wondering how to log queries from Cassandra. These queries can be
> either slow queries or all queries. The only constraint is that I should do
> this on server side.
>
> I tried using `nodetool settraceprobability`, which writes all queries to
> the keyspace `system_traces`. When I try to see which queries are slower
> than a given number, I get:
>
> Result: ```InvalidRequest: code=2200 [Invalid query] message="No secondary
> indexes on the restricted columns support the provided operators: "```
> Query: `select * from events where source_elapsed >= 1000;`
>
> My goal is to debug performance issues in a production database. I want to
> know which queries are degrading the performance of the db.
>
> Thanks in advance!
>
>
>
>
>
>
>