SlideShare une entreprise Scribd logo
1  sur  33
LVE Stats 2 Training
• Modular, extendable and efficient
architecture
o Can monitor anything
o Customize what is monitored
 Use RES mem instead of LVE PMEM
o In memory data analysis - better
performance
o Easy to extend - suspend, notify, etc…
Why LVE Stats v2?
• Better precision
o Only 1 month of data vs 2 months for v1
o Yet, 1 minute intervals vs 1 hour intervals
Why LVE Stats v2?
• Better charts (SVG)
• Include DB Governor statistics
Why LVE Stats v2?
• Faults for CPU/IO
o Not ‘faultable’ resources, just throttled
o We count it as a ‘fault’, once per minute, if limit reached
o Easier to identify/see when user hits the limit
Why LVE Stats v2?
• Collects snapshots
o URL
o Process
o Query
Why LVE Stats v2?
• Backwards compatible by default
o By default lve-stats-2.x runs in backward
compatibility mode.
 lveinfo and lvechart run as before
 Will be changed in ~12 months
• Make new mode default by setting mode=v2 in
/etc/sysconfig/lvestats2
o Or use -m v1|v2 option in lveinfo.
Backwards compatible
• lveinfo/lvechart are backward
compatible
o Old options should work the same
• /var/lve/info populated as before
o Every 5 seconds, used by control panel to
display ‘live’ information
What stayed the same?
• --dbgov -- allows to manipulate DB Governor stats
• -c/--csv [FILE] -- saves data in CSV format
• -j/--json -- json output
• --time-unit -- averages time in output based on the
time unit
• --servers-info for multi-server install, lists servers &
LVE version
• -m v1/v2 -- v1 display output in backward
compatible mode, v2 - new mode
• --blank-value [val] -- substitute instead of
unsupported limit, default -
lveinfo
• -u/--user -- show stats for particular MySQL user
• -l/--limit -- max number of entries in output
• -o/--order-by -- order output by
con/cpu/read/write
• -b/--format -- columns to show
• --csv/--json -- display data in csv or json formats
• --from/--to/--period -- same as lveinfo
lveinfo --dbgov
• Includes DB Governor data on CPU/IO charts
• --format {svg,png} -- allows to use SVG or PNG format, default SVG
What’s new: lvechart
• Top like utility for LVE
o will replace lvetop
• Powers new UI
• Includes DB Governor data
• Supports --json only for now (more later, including live/on screen)
o Used in the next version UI for cPanel/DA/Plesk
• Takes data from:
o /var/lve/cloudlinux_top.json file
o Updated by lvestast v2 every 5 seconds
What’s new: cloudlinux-top
• - hide-mysql - don’t show DB Governor related data
• - u/--username - show data only for specific user,
substring matching
• - d/--domain - show data only for specific domain,
substring matching
• - m/--max - max number of entries to show, default 25
cloudlinux-top options:
• dbgovchart - show DBGovernor charts
• lve-create-db -- creates or re-creates database
for LVE Stats v2.0
• lve-read-snapshot -- reads snapshots for end
user. Can produce data in json, or produce
‘summary’ stats for a particular period
More commands...
• Not on CL5
Storing History: Supported Databases
• Automated upgrade from lve-stats 1.x
once released to production channel
• Automated settings migrations
• Data migrated automatically within first
24 hours
o Throttled, so disks are not overloaded
o No support for migrating stats on centralized
storage
Upgrading: Migrating data
• /var/lve/lvestats2.db -- SQLite db
with all the data
• /var/lve/info -- ‘real time’ usage to
show in control panels
• /var/lve/cloudlinux_top.json -- data
for cloudlinux-top command
Important files
• /etc/sysconfig/lvestats2 -- main config file
• /etc/sysconfig/lvestats.config/ -- config
files for Plugins
o HistoryCleaner.cfg -- how often to remove
data from db
o SnapshotSaver.cfg -- snapshot settings (how
many, how often)
o StatsNotifier.cfg -- Notifications settings
Config files
• db_type = sqlite
• plugins=/usr/share/lve-stats/plugins
• keep_history_days=30
• server_id=7269a505-3
• mode=v1
...
/etc/sysconfig/lvestats2
• NOTIFY_FROM_EMAIL=main_admin@host.com
• NOTIFY_ADMIN=N
• NOTIFY_RESELLER=N
• NOTIFY_CUSTOMER=N
• NOTIFY_INCLUDE_RESELLER_CUSTOMER=N
• NOTIFY_CPU=Y
• NOTIFY_IO=Y
• NOTIFY_IOPS=Y
• NOTIFY_MEMORY=Y
• NOTIFY_EP=Y
• NOTIFY_NPROC=Y
• NOTIFY_MIN_FAULTS_ADMIN=1
• NOTIFY_MIN_FAULTS_USER=1
• NOTIFY_INTERVAL_ADMIN=12h
• NOTIFY_INTERVAL_USER=12h
StatsNotifer.cfg –
Notify when limited
Notification message example
• period_between_incidents=300
• snapshots_per_minute=2
• max_snapshots_per_incident=10
SnapshotSaver.cfg
• Easy way to extend lvestats
• Simple Architecture
• Python based
• http://docs.cloudlinux.com/index.html?creating_a_
plugin.html
Plugins
• Collectors
• Analyzers
• Persistors
• Notifiers
collectors
analyzers
Persistors
Notifiers
Plugin Types
• Generic / always included
• Optional
o LVEDestroyer
o ResMEMCollector
• Custom
More about plugins
• period -- how often to execute, default 5
seconds
• order -- order in the execution sequence,
to decide which plugin goes next
• Any other settings can be set using config
files
Plugin Properties
Name Period Order Default
LVECollector 5 1000 Y
CPUInfoCollector 5 2000 Y
LVEUsernamesCollector 3600 3000 Y
LVEUsageAnalyzer 5 4000 Y
LveUsageAggregator 60 5000 Y
DBGovSaver 5 6000 Y
FileSaver 5 7000 Y
CloudLinuxTopFileSaver 60 8000 Y
Plugins
DBSaver 60 9000 Y
DbUsernamesSaver 3600 10000 Y
DBSaverX60 3600 11000 Y
SnapshotSaver 30 12000 Y
StatsNotifier varied 13000 Y
HistoryCleaner 3600 14000 Y
ResMEMCollector 30 1500 N
LVEDestroyer 5 - N
Plugins
Name Period Order Default
• To enable plugin, copy or link it to /usr/share/lve-
stats/plugins director
• For example to enable ResMEMCollector plugin, do
ln -s /opt/alt/python27/lib/python2.7/site-
packages/lvestats/plugins/generic/res_mem_collecto
r.py /usr/share/lve-stats/plugins/
Adding plugins
# FSize_watcher_collector.py
# Example plugin for monitoring file size.
# Part 1. Collector
import os
from lvestats.core.plugin import LveStatsPlugin
# Key name
COLLECTOR_KEY = 'FSizeWatcher_fsize'
COLLECTOR_KEY_FILENAME = 'FSizeWatcher_fname'
class FSize_watcher_collector (LveStatsPlugin):
# this plugin should be first in chain
order = 0
# File to monitoring
file_to_monitoring = None
def __init__(self):
pass
# Sets configuration to plugin
def set_config(self, config):
self.file_to_monitoring = config.get('file_to_monitoring', None)
pass
# Work method
def execute(self, lve_data):
try:
# if monitoring file absent, do nothing
if self.file_to_monitoring is None or not os.path.exists(self.file_to_monitoring):
return
# Get file size
stat_info = os.stat(self.file_to_monitoring)
fsize = stat_info.st_size
# Place file name and file size to server data dictionary
lve_data[COLLECTOR_KEY_FILENAME] = self.file_to_monitoring
lve_data[COLLECTOR_KEY] = fsize
except (OSError, IOError):
# file absent or any other error - remove size from dictionary
del lve_data[COLLECTOR_KEY]
Example Plugin
• LVE_VERSION LVE version.
• stats -- Dictionary, that contains lve id’s as keys and LVEStat class objects as values. Every LVEStat object
contains values of usages and limits taken from /proc/lve/list file for every LVE Id. Dictionary keys –
integer lve id, including 0 for “default” LVE. This dictionary is updated on each iteration of lvestats-server
(every 5 seconds by default).
LVEStat – is a standard server class, it can be imported with the command from lvestats.core.lvestat
import LVEStat.
The class is described in the file /opt/alt/python27/lib/python2.7/site-packages/lvestats/core/lvestat.py.
Here you can find the whole list of data fields and their functions.
• old_stats -- stats content from the previous iteration. Before the first iteration – empty dictionary.
• totalHz -- When LVE_VERSION is 4, real CPU frequency in Hz multiplied by number of cores. When
LVE_VERSION > 4, CPU speed is in conventional units and equals to 1000000000 * cores (1 GHz per
core).
• procs -- Quantity of CPU/cores.
• lve_usages -- Contains accumulated LVE statistics for each 5-seconds interval in current minute. Cleared
each minute.
• lve_usage -- Contains aggregated LVE Statistics for “previous” minute to store to database. Overwritten
each minute.
Plugin Data Convention
• Python 2.7 (www.python.org): No comment;
• Sqlite (sqlite.org), MySQL (www.mysql.com), MariaDB
(mariadb.org), PostgreSQL (www.postgresql.org)
• Sqlalchemy (sqlalchemy.org): the Python SQL Toolkit and
Object Relational Mapper;
• Alembic (alembic.zzzcomputing.com): database migration tool
for usage with the SQLAlchemy;
• Numpy (numpy.org): package for scientific computing with
Python;
• Sentry (sentry.io): real-time error tracking;
• Prospector (prospector.landscape.io): python static analysis
tool.
Stack technology
Questions?
Twitter.com/CloudLinuxOS Visit CloudLinux.com

Contenu connexe

Similaire à How lve stats2 works for you and your customers

Migrating from Oracle Enterprise Manager 10g to 12c Cloud Control
Migrating from Oracle Enterprise Manager 10g to 12c Cloud ControlMigrating from Oracle Enterprise Manager 10g to 12c Cloud Control
Migrating from Oracle Enterprise Manager 10g to 12c Cloud ControlLeighton Nelson
 
Tips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASETips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASESAP Technology
 
Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Eduardo Castro
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance AnalysisEduardo Castro
 
Dell Storage Management
Dell Storage ManagementDell Storage Management
Dell Storage ManagementDell World
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)DECK36
 
Regain Control Thanks To Prometheus
Regain Control Thanks To PrometheusRegain Control Thanks To Prometheus
Regain Control Thanks To PrometheusEtienne Coutaud
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsSrinivasa Pavan Marti
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsSrinivasa Pavan Marti
 
MySQL sys schema deep dive
MySQL sys schema deep diveMySQL sys schema deep dive
MySQL sys schema deep diveMark Leith
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replicationPoguttuezhiniVP
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuningOutsourceAX
 
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: Monitoring
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: MonitoringvBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: Monitoring
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: MonitoringDan Barr
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorMark Leith
 
MemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastMemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastSingleStore
 

Similaire à How lve stats2 works for you and your customers (20)

Migrating from Oracle Enterprise Manager 10g to 12c Cloud Control
Migrating from Oracle Enterprise Manager 10g to 12c Cloud ControlMigrating from Oracle Enterprise Manager 10g to 12c Cloud Control
Migrating from Oracle Enterprise Manager 10g to 12c Cloud Control
 
Tips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASETips Tricks and Little known features in SAP ASE
Tips Tricks and Little known features in SAP ASE
 
Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance Analysis
 
Dell Storage Management
Dell Storage ManagementDell Storage Management
Dell Storage Management
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
 
Regain Control Thanks To Prometheus
Regain Control Thanks To PrometheusRegain Control Thanks To Prometheus
Regain Control Thanks To Prometheus
 
VS Debugging Tricks
VS Debugging TricksVS Debugging Tricks
VS Debugging Tricks
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
 
E business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administratorsE business suite r12.2 changes for database administrators
E business suite r12.2 changes for database administrators
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
MySQL sys schema deep dive
MySQL sys schema deep diveMySQL sys schema deep dive
MySQL sys schema deep dive
 
RubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngineRubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngine
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuning
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: Monitoring
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: MonitoringvBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: Monitoring
vBrownBag 2015-07-08 - VCP6-DCV Foundations Section 7: Monitoring
 
Getting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise MonitorGetting to Know MySQL Enterprise Monitor
Getting to Know MySQL Enterprise Monitor
 
MySQL 5.1 Replication
MySQL 5.1 ReplicationMySQL 5.1 Replication
MySQL 5.1 Replication
 
MemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastMemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks Webcast
 

Plus de CloudLinux

LVE Manager's New UI
LVE Manager's New UILVE Manager's New UI
LVE Manager's New UICloudLinux
 
Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360CloudLinux
 
Single tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SSingle tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SCloudLinux
 
How to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeHow to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeCloudLinux
 
How to optimize CloudLinux OS limits
How to optimize CloudLinux OS limitsHow to optimize CloudLinux OS limits
How to optimize CloudLinux OS limitsCloudLinux
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSCloudLinux
 

Plus de CloudLinux (6)

LVE Manager's New UI
LVE Manager's New UILVE Manager's New UI
LVE Manager's New UI
 
Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360Keeping web servers safe and profitable with Imunify360
Keeping web servers safe and profitable with Imunify360
 
Single tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8SSingle tenant software to multi-tenant SaaS using K8S
Single tenant software to multi-tenant SaaS using K8S
 
How to deploy KuberDock hassle-free
How to deploy KuberDock hassle-freeHow to deploy KuberDock hassle-free
How to deploy KuberDock hassle-free
 
How to optimize CloudLinux OS limits
How to optimize CloudLinux OS limitsHow to optimize CloudLinux OS limits
How to optimize CloudLinux OS limits
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 

Dernier

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

How lve stats2 works for you and your customers

  • 1. LVE Stats 2 Training
  • 2. • Modular, extendable and efficient architecture o Can monitor anything o Customize what is monitored  Use RES mem instead of LVE PMEM o In memory data analysis - better performance o Easy to extend - suspend, notify, etc… Why LVE Stats v2?
  • 3. • Better precision o Only 1 month of data vs 2 months for v1 o Yet, 1 minute intervals vs 1 hour intervals Why LVE Stats v2?
  • 4. • Better charts (SVG) • Include DB Governor statistics Why LVE Stats v2?
  • 5. • Faults for CPU/IO o Not ‘faultable’ resources, just throttled o We count it as a ‘fault’, once per minute, if limit reached o Easier to identify/see when user hits the limit Why LVE Stats v2?
  • 6. • Collects snapshots o URL o Process o Query Why LVE Stats v2?
  • 7. • Backwards compatible by default o By default lve-stats-2.x runs in backward compatibility mode.  lveinfo and lvechart run as before  Will be changed in ~12 months • Make new mode default by setting mode=v2 in /etc/sysconfig/lvestats2 o Or use -m v1|v2 option in lveinfo. Backwards compatible
  • 8. • lveinfo/lvechart are backward compatible o Old options should work the same • /var/lve/info populated as before o Every 5 seconds, used by control panel to display ‘live’ information What stayed the same?
  • 9. • --dbgov -- allows to manipulate DB Governor stats • -c/--csv [FILE] -- saves data in CSV format • -j/--json -- json output • --time-unit -- averages time in output based on the time unit • --servers-info for multi-server install, lists servers & LVE version • -m v1/v2 -- v1 display output in backward compatible mode, v2 - new mode • --blank-value [val] -- substitute instead of unsupported limit, default - lveinfo
  • 10. • -u/--user -- show stats for particular MySQL user • -l/--limit -- max number of entries in output • -o/--order-by -- order output by con/cpu/read/write • -b/--format -- columns to show • --csv/--json -- display data in csv or json formats • --from/--to/--period -- same as lveinfo lveinfo --dbgov
  • 11. • Includes DB Governor data on CPU/IO charts • --format {svg,png} -- allows to use SVG or PNG format, default SVG What’s new: lvechart
  • 12. • Top like utility for LVE o will replace lvetop • Powers new UI • Includes DB Governor data • Supports --json only for now (more later, including live/on screen) o Used in the next version UI for cPanel/DA/Plesk • Takes data from: o /var/lve/cloudlinux_top.json file o Updated by lvestast v2 every 5 seconds What’s new: cloudlinux-top
  • 13. • - hide-mysql - don’t show DB Governor related data • - u/--username - show data only for specific user, substring matching • - d/--domain - show data only for specific domain, substring matching • - m/--max - max number of entries to show, default 25 cloudlinux-top options:
  • 14. • dbgovchart - show DBGovernor charts • lve-create-db -- creates or re-creates database for LVE Stats v2.0 • lve-read-snapshot -- reads snapshots for end user. Can produce data in json, or produce ‘summary’ stats for a particular period More commands...
  • 15. • Not on CL5 Storing History: Supported Databases
  • 16. • Automated upgrade from lve-stats 1.x once released to production channel • Automated settings migrations • Data migrated automatically within first 24 hours o Throttled, so disks are not overloaded o No support for migrating stats on centralized storage Upgrading: Migrating data
  • 17. • /var/lve/lvestats2.db -- SQLite db with all the data • /var/lve/info -- ‘real time’ usage to show in control panels • /var/lve/cloudlinux_top.json -- data for cloudlinux-top command Important files
  • 18. • /etc/sysconfig/lvestats2 -- main config file • /etc/sysconfig/lvestats.config/ -- config files for Plugins o HistoryCleaner.cfg -- how often to remove data from db o SnapshotSaver.cfg -- snapshot settings (how many, how often) o StatsNotifier.cfg -- Notifications settings Config files
  • 19. • db_type = sqlite • plugins=/usr/share/lve-stats/plugins • keep_history_days=30 • server_id=7269a505-3 • mode=v1 ... /etc/sysconfig/lvestats2
  • 20. • NOTIFY_FROM_EMAIL=main_admin@host.com • NOTIFY_ADMIN=N • NOTIFY_RESELLER=N • NOTIFY_CUSTOMER=N • NOTIFY_INCLUDE_RESELLER_CUSTOMER=N • NOTIFY_CPU=Y • NOTIFY_IO=Y • NOTIFY_IOPS=Y • NOTIFY_MEMORY=Y • NOTIFY_EP=Y • NOTIFY_NPROC=Y • NOTIFY_MIN_FAULTS_ADMIN=1 • NOTIFY_MIN_FAULTS_USER=1 • NOTIFY_INTERVAL_ADMIN=12h • NOTIFY_INTERVAL_USER=12h StatsNotifer.cfg – Notify when limited
  • 22. • period_between_incidents=300 • snapshots_per_minute=2 • max_snapshots_per_incident=10 SnapshotSaver.cfg
  • 23. • Easy way to extend lvestats • Simple Architecture • Python based • http://docs.cloudlinux.com/index.html?creating_a_ plugin.html Plugins
  • 24. • Collectors • Analyzers • Persistors • Notifiers collectors analyzers Persistors Notifiers Plugin Types
  • 25. • Generic / always included • Optional o LVEDestroyer o ResMEMCollector • Custom More about plugins
  • 26. • period -- how often to execute, default 5 seconds • order -- order in the execution sequence, to decide which plugin goes next • Any other settings can be set using config files Plugin Properties
  • 27. Name Period Order Default LVECollector 5 1000 Y CPUInfoCollector 5 2000 Y LVEUsernamesCollector 3600 3000 Y LVEUsageAnalyzer 5 4000 Y LveUsageAggregator 60 5000 Y DBGovSaver 5 6000 Y FileSaver 5 7000 Y CloudLinuxTopFileSaver 60 8000 Y Plugins
  • 28. DBSaver 60 9000 Y DbUsernamesSaver 3600 10000 Y DBSaverX60 3600 11000 Y SnapshotSaver 30 12000 Y StatsNotifier varied 13000 Y HistoryCleaner 3600 14000 Y ResMEMCollector 30 1500 N LVEDestroyer 5 - N Plugins Name Period Order Default
  • 29. • To enable plugin, copy or link it to /usr/share/lve- stats/plugins director • For example to enable ResMEMCollector plugin, do ln -s /opt/alt/python27/lib/python2.7/site- packages/lvestats/plugins/generic/res_mem_collecto r.py /usr/share/lve-stats/plugins/ Adding plugins
  • 30. # FSize_watcher_collector.py # Example plugin for monitoring file size. # Part 1. Collector import os from lvestats.core.plugin import LveStatsPlugin # Key name COLLECTOR_KEY = 'FSizeWatcher_fsize' COLLECTOR_KEY_FILENAME = 'FSizeWatcher_fname' class FSize_watcher_collector (LveStatsPlugin): # this plugin should be first in chain order = 0 # File to monitoring file_to_monitoring = None def __init__(self): pass # Sets configuration to plugin def set_config(self, config): self.file_to_monitoring = config.get('file_to_monitoring', None) pass # Work method def execute(self, lve_data): try: # if monitoring file absent, do nothing if self.file_to_monitoring is None or not os.path.exists(self.file_to_monitoring): return # Get file size stat_info = os.stat(self.file_to_monitoring) fsize = stat_info.st_size # Place file name and file size to server data dictionary lve_data[COLLECTOR_KEY_FILENAME] = self.file_to_monitoring lve_data[COLLECTOR_KEY] = fsize except (OSError, IOError): # file absent or any other error - remove size from dictionary del lve_data[COLLECTOR_KEY] Example Plugin
  • 31. • LVE_VERSION LVE version. • stats -- Dictionary, that contains lve id’s as keys and LVEStat class objects as values. Every LVEStat object contains values of usages and limits taken from /proc/lve/list file for every LVE Id. Dictionary keys – integer lve id, including 0 for “default” LVE. This dictionary is updated on each iteration of lvestats-server (every 5 seconds by default). LVEStat – is a standard server class, it can be imported with the command from lvestats.core.lvestat import LVEStat. The class is described in the file /opt/alt/python27/lib/python2.7/site-packages/lvestats/core/lvestat.py. Here you can find the whole list of data fields and their functions. • old_stats -- stats content from the previous iteration. Before the first iteration – empty dictionary. • totalHz -- When LVE_VERSION is 4, real CPU frequency in Hz multiplied by number of cores. When LVE_VERSION > 4, CPU speed is in conventional units and equals to 1000000000 * cores (1 GHz per core). • procs -- Quantity of CPU/cores. • lve_usages -- Contains accumulated LVE statistics for each 5-seconds interval in current minute. Cleared each minute. • lve_usage -- Contains aggregated LVE Statistics for “previous” minute to store to database. Overwritten each minute. Plugin Data Convention
  • 32. • Python 2.7 (www.python.org): No comment; • Sqlite (sqlite.org), MySQL (www.mysql.com), MariaDB (mariadb.org), PostgreSQL (www.postgresql.org) • Sqlalchemy (sqlalchemy.org): the Python SQL Toolkit and Object Relational Mapper; • Alembic (alembic.zzzcomputing.com): database migration tool for usage with the SQLAlchemy; • Numpy (numpy.org): package for scientific computing with Python; • Sentry (sentry.io): real-time error tracking; • Prospector (prospector.landscape.io): python static analysis tool. Stack technology