Foreman takes too long when getting reports

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven't been "purged" in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don't see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my "expire reports" hasn't been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as "Number of reports" from reports;

If your using RemoteAdmin this is ticket # https://github.com/logicminds/remoteadmin-mobile/issues/2

Corey

I'm having the issue. It ran for about 2 minutes before it returned
something. I noticed my mysqld process was pegged at 100% during this
time.

I have 19,265 reports.

Regards,
Jake

··· On Jun 23, 1:20 pm, Corey Osman wrote: > Hi, > > I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen. > > This url will return the last 5 reports for host specified in the search=FQDN > > https://foreman/reports?page=1&format=json&numreports=5&search=FQDN > > Sometimes this query can take 20+ seconds. > > For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven't been "purged" in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don't see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports. > > I think the main problem is I have too many reports to search through in a given amount of time and my "expire reports" hasn't been running correctly and the script will take hours to finish with that many reports. > > Can you count the number of reports you have?: > > Mysql query: > > select count(*) as "Number of reports" from reports; > > If your using RemoteAdmin this is ticket #https://github.com/logicminds/remoteadmin-mobile/issues/2 > > Corey

Corey,

I'm porting my environment over to MySQL today, will let you know a) if it fixes the Foreman problem on our side, and b) if that fixes the RA problem for us.

-Eric

··· -- Eric Shamow Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 2:20 PM, Corey Osman wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven’t been “purged” in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don’t see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my “expire reports” hasn’t been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket # individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

> Hi,
> I wanted to confirm this with other people before opening a ticket. It
> seems a few people (including myself) have run into this issue when using my
> mobile app. However, when I ran directly through foreman the same issue
> happen.
> This url will return the last 5 reports for host specified in the
> search=FQDN
> https://foreman/reports?page=1&format=json&numreports=5&search=FQDN
this search term is a free text search term --> it would take a long
time to run as it search all reports attributes in order to find a
matching string
use host = fqdn as the search term instead
alterntivily, simply use the rest url:

foreman/hosts/fqdn/reports?numreports=5 …

Ohad

··· On Thu, Jun 23, 2011 at 9:20 PM, Corey Osman wrote: > > Sometimes this query can take 20+ seconds. > For those of you running foreman 0.3 can you try this url in your > environment? I suspect in environments where reports haven't been "purged" > in a while there are too many reports for foreman to search through and > foreman never returns the results. In my personal test foreman environment > with 3 hosts I don't see this problem. However, in my larger production > environment the problem is present because I have so many reports. > Currently I have 28,000 reports. > I think the main problem is I have too many reports to search through in a > given amount of time and my "expire reports" hasn't been running correctly > and the script will take hours to finish with that many reports. > > Can you count the number of reports you have?: > Mysql query: > select count(*) as "Number of reports" from reports; > > If your using RemoteAdmin this is ticket > # https://github.com/logicminds/remoteadmin-mobile/issues/2 > > Corey > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en. >

I really think the issue is tied to the number of reports. Are you doing a migration of your database or starting from scratch with mysql?

Corey

··· On Jun 23, 2011, at 11:23 AM, Eric Shamow wrote:

Corey,

I’m porting my environment over to MySQL today, will let you know a) if it fixes the Foreman problem on our side, and b) if that fixes the RA problem for us.

-Eric


Eric Shamow
Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 2:20 PM, Corey Osman wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven’t been “purged” in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don’t see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my “expire reports” hasn’t been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket # individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

DB migration. I'd like to see the effect of the same dataset/size and it took a couple of months to build. Besides, don't want to lose all my history :slight_smile:

··· -- Eric Shamow Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 3:25 PM, Corey Osman wrote:

I really think the issue is tied to the number of reports. Are you doing a migration of your database or starting from scratch with mysql?

Corey

On Jun 23, 2011, at 11:23 AM, Eric Shamow wrote:

Corey,

I’m porting my environment over to MySQL today, will let you know a) if it fixes the Foreman problem on our side, and b) if that fixes the RA problem for us.

-Eric


Eric Shamow
Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 2:20 PM, Corey Osman wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven’t been “purged” in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don’t see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my “expire reports” hasn’t been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket # individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

What happens when you guys run the expire reports rake command. I normally see these errors.

/etc/foreman/expirereports.sh: line 8: unexpected EOF while looking for matching `"'
/etc/foreman/expirereports.sh: line 10: syntax error: unexpected end of file

inside expirereports.sh:

cd /opt/foreman
RAILS_ENV="production"

rake reports:expire days=7 RAILS_ENV="production"
rake reports:expire days=1 status=0 RAILS_ENV="production

Corey

··· On Jun 23, 2011, at 1:34 PM, Jake - USPS wrote:

I’m having the issue. It ran for about 2 minutes before it returned
something. I noticed my mysqld process was pegged at 100% during this
time.

I have 19,265 reports.

Regards,
Jake

On Jun 23, 1:20 pm, Corey Osman co...@logicminds.biz wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven’t been “purged” in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don’t see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my “expire reports” hasn’t been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket #individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

Yep, that was like .1 sec now.

Regards,
Jake

··· On Jun 24, 12:33 am, Ohad Levy wrote: > On Thu, Jun 23, 2011 at 9:20 PM, Corey Osman wrote: > > Hi, > > I wanted to confirm this with other people before opening a ticket. It > > seems a few people (including myself) have run into this issue when using my > > mobile app. However, when I ran directly through foreman the same issue > > happen. > > This url will return the last 5 reports for host specified in the > > search=FQDN > >https://foreman/reports?page=1&format=json&numreports=5&search=FQDN > > this search term is a free text search term --> it would take a long > time to run as it search all reports attributes in order to find a > matching string > use host = fqdn as the search term instead > alterntivily, simply use the rest url: > > foreman/hosts/fqdn/reports?numreports=5 ... > > Ohad > > > > > > > > > > > Sometimes this query can take 20+ seconds. > > For those of you running foreman 0.3 can you try this url in your > > environment? I suspect in environments where reports haven't been "purged" > > in a while there are too many reports for foreman to search through and > > foreman never returns the results. In my personal test foreman environment > > with 3 hosts I don't see this problem. However, in my larger production > > environment the problem is present because I have so many reports. > > Currently I have 28,000 reports. > > I think the main problem is I have too many reports to search through in a > > given amount of time and my "expire reports" hasn't been running correctly > > and the script will take hours to finish with that many reports. > > > Can you count the number of reports you have?: > > Mysql query: > > select count(*) as "Number of reports" from reports; > > > If your using RemoteAdmin this is ticket > > # https://github.com/logicminds/remoteadmin-mobile/issues/2 > > > Corey > > > -- > > You received this message because you are subscribed to the Google Groups > > "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to > > foreman-users+unsubscribe@googlegroups.com. > > For more options, visit this group at > >http://groups.google.com/group/foreman-users?hl=en.

We have just over 30 000 reports and the url took about a minute to return.

mysqld was pegged at 100% during the query, but we have enough CPU available
that this isn't a problem for us. Indeed, we're thinking of turning off
reporting to foreman because we don't use it - we primarily use the tagmail
functionality instead.

We also perform the report expiration via cron, as described here:
http://theforeman.org/projects/foreman/wiki/Puppet_Reports

Cheers,

Iain

··· On 24 June 2011 06:34, Jake - USPS wrote:

I’m having the issue. It ran for about 2 minutes before it returned
something. I noticed my mysqld process was pegged at 100% during this
time.

I have 19,265 reports.

Regards,
Jake

On Jun 23, 1:20 pm, Corey Osman co...@logicminds.biz wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It
seems a few people (including myself) have run into this issue when using my
mobile app. However, when I ran directly through foreman the same issue
happen.

This url will return the last 5 reports for host specified in the
search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your
environment? I suspect in environments where reports haven’t been “purged”
in a while there are too many reports for foreman to search through and
foreman never returns the results. In my personal test foreman environment
with 3 hosts I don’t see this problem. However, in my larger production
environment the problem is present because I have so many reports.
Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in
a given amount of time and my “expire reports” hasn’t been running correctly
and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket #
individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Please document your migration strategy.

I never got to use this because of my old ruby environment but it might work for you.

Corey

··· On Jun 23, 2011, at 12:26 PM, Eric Shamow wrote:

DB migration. I’d like to see the effect of the same dataset/size and it took a couple of months to build. Besides, don’t want to lose all my history :slight_smile:


Eric Shamow
Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 3:25 PM, Corey Osman wrote:

I really think the issue is tied to the number of reports. Are you doing a migration of your database or starting from scratch with mysql?

Corey

On Jun 23, 2011, at 11:23 AM, Eric Shamow wrote:

Corey,

I’m porting my environment over to MySQL today, will let you know a) if it fixes the Foreman problem on our side, and b) if that fixes the RA problem for us.

-Eric


Eric Shamow
Sent with Sparrow (http://www.sparrowmailapp.com)

On Thursday, June 23, 2011 at 2:20 PM, Corey Osman wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It seems a few people (including myself) have run into this issue when using my mobile app. However, when I ran directly through foreman the same issue happen.

This url will return the last 5 reports for host specified in the search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your environment? I suspect in environments where reports haven’t been “purged” in a while there are too many reports for foreman to search through and foreman never returns the results. In my personal test foreman environment with 3 hosts I don’t see this problem. However, in my larger production environment the problem is present because I have so many reports. Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in a given amount of time and my “expire reports” hasn’t been running correctly and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket # individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com (mailto:foreman-users@googlegroups.com).
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com (mailto:foreman-users+unsubscribe@googlegroups.com).
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en.

You need a closing doublequote on the last line

rake reports:expire days=1 status=0 RAILS_ENV="production" # <– just here

··· On 24 June 2011 08:59, Corey Osman wrote:

What happens when you guys run the expire reports rake command. I normally
see these errors.

/etc/foreman/expirereports.sh: line 8: unexpected EOF while looking for
matching `"’
/etc/foreman/expirereports.sh: line 10: syntax error: unexpected end of
file

inside expirereports.sh:

cd /opt/foreman
RAILS_ENV=“production”

rake reports:expire days=7 RAILS_ENV=“production”
rake reports:expire days=1 status=0 RAILS_ENV="production

Corey

On Jun 23, 2011, at 1:34 PM, Jake - USPS wrote:

I’m having the issue. It ran for about 2 minutes before it returned
something. I noticed my mysqld process was pegged at 100% during this
time.

I have 19,265 reports.

Regards,
Jake

On Jun 23, 1:20 pm, Corey Osman co...@logicminds.biz wrote:

Hi,

I wanted to confirm this with other people before opening a ticket. It
seems a few people (including myself) have run into this issue when using my
mobile app. However, when I ran directly through foreman the same issue
happen.

This url will return the last 5 reports for host specified in the
search=FQDN

https://foreman/reports?page=1&format=json&numreports=5&search=FQDN

Sometimes this query can take 20+ seconds.

For those of you running foreman 0.3 can you try this url in your
environment? I suspect in environments where reports haven’t been “purged”
in a while there are too many reports for foreman to search through and
foreman never returns the results. In my personal test foreman environment
with 3 hosts I don’t see this problem. However, in my larger production
environment the problem is present because I have so many reports.
Currently I have 28,000 reports.

I think the main problem is I have too many reports to search through in
a given amount of time and my “expire reports” hasn’t been running correctly
and the script will take hours to finish with that many reports.

Can you count the number of reports you have?:

Mysql query:

select count(*) as “Number of reports” from reports;

If your using RemoteAdmin this is ticket #
individual System Reports never loads · Issue #2 · logicminds/remoteadmin-mobile · GitHub

Corey


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.