Sponsored Content
Top Forums UNIX for Advanced & Expert Users Nearly Random, Uncorrelated Server Load Average Spikes Post 303044125 by Neo on Friday 14th of February 2020 09:48:03 AM
Old 02-14-2020
Exactly Victor,

It's not a big deal because the spikes are just for a minute 4 to 6 times a day; but the problem is when (potentially) all the "bad things" align all at once (bots, DB, system loads), and the one minute problem becomes a two or three minute problem (it's possible, of course).

I'm going to refine my instrumentation and see if I can figure it out. If so, great. Normally, I can solve most any system-level computer problem and with (more than) a bit of uncertainty in the new COVID-19 biohazard around these parts, I'm not so keen in going out with so many tourists here now (none of the foreign tourists are wearing masks, as I can see today, and there are a LOT of tourists now) ; so this little spike problem is keeping me busy inside, avoiding a potential virus from Chinese wildlife markets.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

load average

we have an unix system which has load average normally about 20. but while i am running a particular unix batch which performs heavy operations on filesystem and database average load reduces to 15. how can we explain this situation? while running that batch idle cpu time is about %60-65... (0 Replies)
Discussion started by: gfhgfnhhn
0 Replies

2. UNIX for Dummies Questions & Answers

Load Average

Hello all, I have a question about load averages. I've read the man pages for the uptime and w command for two or three different flavors of Unix (Red Hat, Tru64, Solaris). All of them agree that in the output of the 2 aforementioned commands, you are given the load average for the box, but... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies

3. UNIX for Dummies Questions & Answers

top - Load average

Hello, Here is the output of top command. My understanding here is, the load average 0.03 in last 1 min, 0.02 is in last 5 min, 0.00 is in last 15 min. By seeing this load average, When can we say that, the system load averge is too high? When can we say that, load average is medium/low??... (8 Replies)
Discussion started by: govindts
8 Replies

4. Solaris

load average query.

Hi, i have installed solaris 10 on t-5120 sparc enterprise. I am little surprised to see load average of 2 or around on this OS. when checked with ps command following process is using highest CPU. looks like it is running for long time and does not want to stop, but I do not know... (5 Replies)
Discussion started by: upengan78
5 Replies

5. UNIX for Dummies Questions & Answers

Please Help me in my load average

Hello AlL,.. I want from experts to help me as my load average is increased and i dont know where is the problem !! this is my top result : root@a4s # top top - 11:30:38 up 40 min, 1 user, load average: 3.06, 2.49, 4.66 Mem: 8168788k total, 2889596k used, 5279192k free, 47792k... (3 Replies)
Discussion started by: black-code
3 Replies

6. UNIX for Advanced & Expert Users

Load average in UNIX

Hi , I am using 48 CPU sunOS server at my work. The application has facility to check the current load average before starting a new process to control the load. Right now it is configured as 48. So it does mean that each CPU can take maximum one proces and no processe is waiting. ... (2 Replies)
Discussion started by: kumaran_5555
2 Replies

7. Solaris

Load Average and Lwps

NPROC USERNAME SWAP RSS MEMORY TIME CPU 320 oracle 23G 22G 69% 582:55:11 85% 47 root 148M 101M 0.3% 99:29:40 0.3% 53 rafmsdb 38M 60M 0.2% 0:46:17 0.1% 1 smmsp 1296K 5440K 0.0% 0:00:08 0.0% 7 daemon ... (2 Replies)
Discussion started by: snjksh
2 Replies

8. UNIX for Dummies Questions & Answers

Load average spikes once an hour

Hi, I am getting a high load average, around 7, once an hour. It last for about 4 minutes and makes things fairly unusable for this time. How do I find out what is using this. Looking at top the only thing running at the time is md5sum. I have looked at the crontab and there is nothing... (10 Replies)
Discussion started by: sm9ai
10 Replies

9. UNIX for Dummies Questions & Answers

Help with load average?

how load average is calculated and what exactly is it difference between cpu% and load average (9 Replies)
Discussion started by: robo
9 Replies

10. Programming

ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages

Here we go.... Preface: ..... so in a galaxy far, far, far away from commercial, data sharing corporations..... For this project, I used the ESP-WROOM-32 as an MQTT (publish / subscribe) client which receives Linux server "load averages" as messages published as MQTT pub/sub messages.... (6 Replies)
Discussion started by: Neo
6 Replies
DateTime::Format::Builder::Tutorial(3pm)		User Contributed Perl Documentation		  DateTime::Format::Builder::Tutorial(3pm)

NAME
DateTime::Format::Builder::Tutorial - Quick class on using Builder CREATING A CLASS
As most people who are writing modules know, you start a package with a package declaration and some indication of module version: package DateTime::Format::ICal; our $VERSION = '0.04'; After that, you call Builder with some options. There are only a few (detailed later). Right now, we're only interested in parsers. use DateTime::Format::Builder ( parsers => { ... } ); The parsers option takes a reference to a hash of method names and specifications: parsers => { parse_datetime => ... , parse_datetime_with_timezone => ... , ... } Builder will create methods in your class, each method being a parser that follows the given specifications. It is strongly recommended that one method is called parse_datetime, be it a Builder created method or one of your own. In addition to creating any of the parser methods it also creates a "new()" method that can instantiate (or clone) objects of this class. This behaviour can be modified with the constructor option, but we don't need to know that yet. Each value corresponding to a method name in the parsers list is either a single specification, or a list of specifications. We'll start with the simple case. parse_briefdate => { params => [ qw( year month day ) ], regex => qr/^(dddd)(dd)(dd)$/, }, This will result in a method named parse_briefdate which will take strings in the form 20040716 and return DateTime objects representing that date. A user of the class might write: use DateTime::Format::ICal; my $date = "19790716"; my $dt = DateTime::Format::ICal->parse_briefdate( $date ); print "My birth month is ", $dt->month_name, " "; The "regex" is applied to the input string, and if it matches, then $1, $2, ... are mapped to the params given and handed to "DateTime->new()". Essentially: my $rv = DateTime->new( year => $1, month => $2, day => $3 ); There are more complicated things one can do within a single specification, but we'll cover those later. Often, you'll want a method to be able to take one string, and run it against multiple parser specifications. It would be very irritating if the user had to work out what format the datetime string was in and then which method was most appropriate. So, Builder lets you specify multiple specifications: parse_datetime => [ { params => [ qw( year month day hour minute second ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)(dd)$/, }, { params => [ qw( year month day hour minute ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)$/, }, { params => [ qw( year month day hour ) ], regex => qr/^(dddd)(dd)(dd)T(dd)$/, }, { params => [ qw( year month day ) ], regex => qr/^(dddd)(dd)(dd)$/, }, ], It's an arrayref of specifications. A parser will be created that will try each of these specifications sequentially, in the order you specified. There's a flaw with this though. In this example, we're building a parser for ICal datetimes. One can place a timezone id at the start of an ICal datetime. You might extract such an id with the following code: if ( $date =~ s/^TZID=([^:]+):// ) { $time_zone = $1; } # Z at end means UTC elsif ( $date =~ s/Z$// ) { $time_zone = 'UTC'; } else { $time_zone = 'floating'; } $date would end up without the id, and $time_zone would contain something appropriate to give to DateTime's set_time_zone method, or time_zone argument. But how to get this scrap of code into your parser? You might be tempted to call the parser something else and build a small wrapper. There's no need though because an option is provided for preprocesing dates: parse_datetime => [ [ preprocess => &_parse_tz ], # Only changed line! { params => [ qw( year month day hour minute second ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)(dd)$/, }, { params => [ qw( year month day hour minute ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)$/, }, { params => [ qw( year month day hour ) ], regex => qr/^(dddd)(dd)(dd)T(dd)$/, }, { params => [ qw( year month day ) ], regex => qr/^(dddd)(dd)(dd)$/, }, ], It will necessitate _parse_tz to be written, and that routine looks like this: sub _parse_tz { my %args = @_; my ($date, $p) = @args{qw( input parsed )}; if ( $date =~ s/^TZID=([^:]+):// ) { $p->{time_zone} = $1; } # Z at end means UTC elsif ( $date =~ s/Z$// ) { $p->{time_zone} = 'UTC'; } else { $p->{time_zone} = 'floating'; } return $date; } On input it is given a hash containing two items: the input date and a hashref that will be used in the parsing. The return value from the routine is what the parser specifications will run against, and anything in the parsed hash ($p in the example) will be put in the call to "DateTime->new(...)". So, we now have a happily working ICal parser. It parses the assorted formats, and can also handle timezones. Is there anything else it needs to do? No. But we can make it work more efficiently. At present, the specifications are tested sequentially. However, each one applies to strings of particular lengths. Thus we could be efficient and have the parser only test the given strings against a parser that handles that string length. Again, Builder makes it easy: parse_datetime => [ [ preprocess => &_parse_tz ], { length => 15, # We handle strings of exactly 15 chars params => [ qw( year month day hour minute second ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)(dd)$/, }, { length => 13, # exactly 13 chars... params => [ qw( year month day hour minute ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)$/, }, { length => 11, # 11.. params => [ qw( year month day hour ) ], regex => qr/^(dddd)(dd)(dd)T(dd)$/, }, { length => 8, # yes. params => [ qw( year month day ) ], regex => qr/^(dddd)(dd)(dd)$/, }, ], Now the created parser will create a parser that only runs specifications against appropriate strings. So our complete code looks like: package DateTime::Format::ICal; use strict; our $VERSION = '0.04'; use DateTime::Format::Builder ( parsers => { parse_datetime => [ [ preprocess => &_parse_tz ], { length => 15, params => [ qw( year month day hour minute second ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)(dd)$/, }, { length => 13, params => [ qw( year month day hour minute ) ], regex => qr/^(dddd)(dd)(dd)T(dd)(dd)$/, }, { length => 11, params => [ qw( year month day hour ) ], regex => qr/^(dddd)(dd)(dd)T(dd)$/, }, { length => 8, params => [ qw( year month day ) ], regex => qr/^(dddd)(dd)(dd)$/, }, ], }, ); sub _parse_tz { my %args = @_; my ($date, $p) = @args{qw( input parsed )}; if ( $date =~ s/^TZID=([^:]+):// ) { $p->{time_zone} = $1; } # Z at end means UTC elsif ( $date =~ s/Z$// ) { $p->{time_zone} = 'UTC'; } else { $p->{time_zone} = 'floating'; } return $date; } 1; And that's an ICal parser. The actual DateTime::Format::ICal module also includes formatting methods and parsing for durations, but Builder doesn't support those yet. A drop in replacement (at the time of writing the replacement) can be found in the examples directory of the Builder distribution, along with similar variants of other common modules. SUPPORT
Any errors you see in this document, please log them with CPAN RT system via the web or email: http://perl.dellah.org/rt/dtbuilder bug-datetime-format-builder@rt.cpan.org This makes it much easier for me to track things and thus means your problem is less likely to be neglected. LICENSE AND COPYRIGHT
Copyright X Iain Truskett, 2003. All rights reserved. You can redistribute this document and/or modify it under the same terms as Perl itself. The full text of the licenses can be found in the Artistic and COPYING files included with this document. AUTHOR
Iain Truskett <spoon@cpan.org> SEE ALSO
"datetime@perl.org" mailing list. http://datetime.perl.org/ perl, DateTime, DateTime::Format::Builder perl v5.10.1 2010-03-14 DateTime::Format::Builder::Tutorial(3pm)
All times are GMT -4. The time now is 01:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy