Search

Clear filter
Announcement
Evgeny Shvarov · Oct 19, 2016

InterSystems UK Technology Summit 2016 started!

Hi, Community! I'm glad to announce UK Technology Summit 2016 started! #ISCTech2016 tag will help be in touch with all is happening in the Summit. You are very welcome to discuss the Summit here in comments too!
Announcement
Janine Perkins · Feb 2, 2016

Featured InterSystems Online Courses - Zen Mojo

Do you need to quickly build a web page to interact with your database? Take a look at these two courses to learn how Zen Mojo can help you display collections and make your collections respond to user interactions. Displaying Collections and Using the Zen Mojo Documentation Learn the steps for displaying a collection of Caché data on a Zen Mojo page, find crucial information in the Zen Mojo documentation, and find sample code in the Widget Reference. Learn More. Zen Mojo: Handling Events and Updating Layouts This is an entirely hands-on course devoted to event handling and updating the display of a Zen Mojo page in response to user interaction. Learn to create a master-detail view that responds to user selections. Learn More.
Article
Murray Oldfield · Mar 11, 2016

InterSystems Data Platforms and performance – Part 2

In the last post we scheduled 24-hour collections of performance metrics using pButtons. In this post we are going to be looking at a few of the key metrics that are being collected and how they relate to the underlying system hardware. We will also start to explore the relationship between Caché (or any of the InterSystems Data Platforms) metrics and system metrics. And how you can use these metrics to understand the daily beat rate of your systems and diagnose performance problems. [A list of other posts in this series is here](https://community.intersystems.com/post/capacity-planning-and-performance-series-index) ***Edited Oct 2016...*** *[Example of script to extract pButtons data to a .csv file is here.](https://community.intersystems.com/post/extracting-pbuttons-data-csv-file-easy-charting)* ***Edited March 2018...*** Images had disappeared, added them back in. # Hardware food groups ![Hardware Food Groups](https://community.intersystems.com/sites/default/files/inline/images/foodgroups_0.png "Hardware Food Groups") As you will see as we progress through this series of posts the server components affecting performance can be itemised as: - CPU - Memory - Storage IO - Network IO If any of these components is under stress then system performance and user experience will likely suffer. These components are all related to each other as well, changes to one component can affect another, sometimes with unexpected consequences. I have seen an example where fixing an IO bottleneck in a storage array caused CPU usage to jump to 100% resulting in even worse user experience as the system was suddenly free to do more work but did not have the CPU resources to service increased user activity and throughput. We will also see how Caché system activity has a direct impact on server components. If there are limited storage IO resources a positive change that can be made is increasing system memory and increasing memory for __Caché global buffers__ which in turn can lower __system storage read IO__ (but perhaps increase CPU!). One of the most obvious system metrics to monitor regularly or check when users report problems is CPU usage. Looking at _top_ or _nmon_ on Linux or AIX, or _Windows Performance Monitor_. Because most system administrators look at CPU data regularly, especially if it is presented graphically, a quick glance gives you a good feel for the current health of your system -- what is normal or a sudden spike in activity that might be abnormal or indicates a problem. In this post we are going to look quickly at CPU metrics, but will concentrate on Caché metrics, we will start by looking at _mgstat_ data and how looking at the data graphically can give a feel for system health at a glance. # Introduction to mgstat mgstat is one of the Caché commands included and run in pButtons. mgstat is a great tool for collecting basic performance metrics to help you understand your systems health. We will look at mgstat data collected from a 24 hour pButtons, but if you want to capture data outside pButtons mgstat can also be run on demand interactively or as a background job from Caché terminal. To run mgstat on demand from the %SYS namespace the general format is. do mgstat(sample_time,number_of_samples,"/file_path/file.csv",page_length) For example to run a background job for a one hour run with 5 seconds sample period and output to a csv file. job ^mgstat(5,720,"/data/mgstat_todays_date_and_time.csv") For example to display to the screen but dropping some columns use the dsp132 entry. I will leave as homework for you to check the output to understand the difference. do dsp132^mgstat(5,720,"",60) > Detailed information of the columns in mgstat can be found in the _Caché Monitoring Guide_ in the most recent Caché documentation: > [InterSystems online documentation](https://docs.intersystems.com) # Looking at mgstat data pButtons has been designed to be collated into a single HTML file for easy navigation and packaging for sending to WRC support specialists to diagnose performance problems. However when you run pButtons for yourself and want to graphically display the data it can be separated again to a csv file for processing into graphs, for example with Excel, by command line script or simple cut and paste. In this post we will dig into just a few of the mgstat metrics to show how even a quick glance at data can give you a feel for whether the system is performing well or there are current or potential problems that will effect the user experience. ## Glorefs and CPU The following chart shows database server CPU usage at a site running a hospital application at a high transaction rate. Note the morning peak in activity when there are a lot of outpatient clinics with a drop-off at lunch time then tailing off in the afternoon and evening. In this case the data came from Windows Performance Monitor _(_Total)\% Processor Time_ - the shape of the graph fits the working day profile - no unusual peaks or troughs so this is normal for this site. By doing the same for your site you can start to get a baseline for "normal". A big spike, especially an extended one can be an indicator of a problem, there is a future post that focuses on CPU. ![CPU Time](https://community.intersystems.com/sites/default/files/inline/images/cpu_time.png "CPU Time") As a reference this database server is a Dell R720 with two E5-2670 8-core processors, the server has 128 GB of memory, and 48 GB of global buffers. The next chart shows more data from mgstat — Glorefs (Global references) or database accesses for the same day as the CPU graph. Glorefs Indicates the amount of work that is occurring on behalf of the current workload; although global references consume CPU time, they do not always consume other system resources such as physical reads because of the way Caché uses the global memory buffer pool. ![Global References](https://community.intersystems.com/sites/default/files/inline/images/glorefs_0.png "Global References") Typical of Caché applications there is a very strong correlation between Glorefs and CPU usage. >Another way of looking at this CPU and gloref data is to say that _reducing glorefs will reduce CPU utilisation_, enabling deployment on lower core count servers or to scale further on existing systems. There may be ways to reduce global reference by making an application more efficient, we will revisit this concept in later posts. ## PhyRds and Rdratio The shape of data from graphing mgstat data _PhyRds_ (Physical Reads) and _Rdratio_ (Read ratio) can also give you an insight into what to expect of system performance and help you with capacity planning. We will dig deeper into storage IO for Caché in future posts. _PhyRds_ are simply physical read IOPS from disk to the Caché databases, you should see the same values reflected in operating system metrics for logical and physical disks. Remember looking at operating system IOPS may be showing IOPS coming from non-Caché applications as well. Sizing storage and not accounting for expected IOPS is a recipe for disaster, you need to know what IOPS your system is doing at peak times for proper capacity planning. The following graph shows _PhyRds_ between midnight and 15:30. ![Physical Reads](https://community.intersystems.com/sites/default/files/inline/images/phyrds.png "Physical Reads") Note the big jump in reads between 05:30 and 10:00. With other shorter peaks at 11:00 and just before 14:00. What do you think these are caused by? Do you see these type of peaks on your servers? _Rdratio_ is a little more interesting — it is the ratio of logical block reads to physical block reads. So a ratio of how many reads are from global buffers (logical) from memory and how many are from disk which is orders of magnitude slower. A high _Rdratio_ is a good thing, dropping close to zero for extended periods is not good. ![Read Ratio](https://community.intersystems.com/sites/default/files/inline/images/rdratio.png "Read Ratio") Note that the same time as high reads _Rdratio_ drops close to zero. At this site I was asked to investigate when the IT department started getting phone calls from users reporting the system was slow for extended periods. This had been going on seemingly at random for several weeks when I was asked to look at the system. > _**Because pButtons had been scheduled for daily 24-hour runs it was relatively simple to go back through several weeks data to start seeing a pattern of high _PhyRds_ and low _Rdratio_ which correlated with support calls.**_ After further analysis the cause was tracked to a new shift worker who was running several reports entering 'bad' parameters combined with badly written queries without appropriate indexes causing the high database reads. This accounted for the seemingly random slowness. Because these long running reports are reading data into global buffers the result is interactive user’s data is being fetched from physical storage, rather than memory as well as storage being stressed to service the reads. Monitoring _PhyRds_ and _Rdratio_ will give you an idea of the beat rate of your systems and maybe allow you to track down bad reports or queries. There may be valid reason for high _PhyRds_ -- perhaps a report must be run at a certain time. With modern 64-bit operating systems and servers with large physical memory capacity you should be able to minimise _PhyRds_ on your production systems. > If you do see high _PhyRds_ on your system there are a couple of strategies you can consider: > - Improve the performance by increasing the number of database (global) buffers (and system memory). > - Long running reports or extracts can be moved out of business hours. > - Long running read only reports, batch jobs or data extracts can be run on a separate shadow server or asynchronous mirror to minimise the impact on interactive users and to offload system resource use such as CPU and IOPS. Usually low _PhyRds_ is a good thing and it's what we aim for when we size systems. However if you have low _PhyRds_ and users are complaining about performance there are still things that can be checked to ensure storage is not a bottleneck - the reads may be low because the system cannot service any more. We will look at storage closer in a future post. # Summary In this post we looked at how graphing the metrics collected in pButtons can give a health check at a glance. In upcoming posts I will dig deeper into the relationship between the system and Caché metrics and how you can use these to plan for the future. Murray, thank you for the series of articles.A couple of questions I have.1) Documentation (2015.1) states that Rdratio is a Ratio of physical block reads to logical block reads,while one can see in mgstat log Rdratio values >> 1 (usually 1000 and more). Don't you think that the definition should be reversed?2) You wrote that:If you do see high PhyRds on your system there are a couple of strategies you can consider:...- Long running read only reports, batch jobs or data extracts can be run on a separate shadow server or asynchronous mirror to minimise impact on interactive users and to offload system resource use such as CPU and IOPS.I heard this advice many times, but how to return report results back to primary member? (ECP) mounting of remote database that resides on primary member is prohibited on backup member, and vise versa. Or these restrictions does not apply to asynchronous members (never played with them yet)? Murray thanks for your articles. But I think, should be mentioned metrics related to Write Daemon too, such as WDphase and WDQsz. Some time when our system looks works too slow, it may depends how quickly our disks can write. And I think in this case it is very usefull metrics. In my own experience I saw when in usual day our server started to work to slow in we saw that writedaemon all time was in 8 phase, and with PhyWrs we can count how many blocks were really written on a disk, and it was not so big count in that time, and so we found a problem in our storage, something related with snapshots. And when storage was reconfigured, our witedaemon continued to work as before quickly. I believe the correct statement is that Rdratio is the ratio of logical block reads to physical block reads, but is zero if physical block reads is zero. Thanks! Yes I wrote the wrong way around in the post. I have fixed this now. The latest Caché documentation has details and examples for setting up read only or read/write asynchronous report mirror. The asynch reporting mirror is special because it is not used for high availability. For example it is not a DR server.At the highest level running reports or extracts on a shadow is possible simply because the data exists on the other server in near real time. Operational or time-critcal reports should be run on the primary servers. The suggestion is that resource heavy reports or extracts can use the shadow or reporting server. While setting up a shadow or reporting asynch mirror is part of Caché, how a report or extract is scheduled or run is an application design question, and not something I can answer - hopefully someone else can jump in here with some advice or experience.Posibilities may include web services or if you use ODBC your application could direct queries to the shadow or a reporting asynch mirror. For batch reports or extracts routines could be scheduled on the shadow/reporting asynch mirror via task manager. Or you may have a sepearte application module for this type of reporting. If you need to have results returned to the application on the primary production that is also application dependant.You should also consider how to handle (e.g. via global mapping) any read/write application databases such as audit or logs which may be overwritten by the primary server. If you are going to do reporting on a shadow server search the online documentation for special considerations for "Purging Cached Queries". There are several more aticles to come before we are done with storage IO I will focus more on IOPS and writes in comming weeks. And will show some examples and solutions to the type of problem you mentioned.Thanks, for the comment. I have quite a few more articles (in my head) for this series, I will be using the comments to help me decide which topics you all are interested in. Rdratio is a little more interesting — it is the ratio of logical block reads to physical block reads.Don't you think that zero values of Rdratio is a special case, as David Marcus mentioned?In mgstat (per second) logs I have at hand I've found them always accompanied with zero values of PhyRds. Just one thing; one good tool to use on Linux is dstat.It is not installed by default, but once you have it (apt-get install dstat on Debian and derivates, yum install dstat on RHEL), you can observe the live behavior of your system as a whole with:dstat -ldcymsnIt gives quite a lot of information! Would it be possible to fix the image links to this post? Hi Mack, sorry about that, the images are back!
Announcement
Evgeny Shvarov · Mar 14, 2017

Join InterSystems Global Masters Gamification Platform!

Hi Community! We want to invite you to join the InterSystems Gamification Platform called Global Masters Advocate Hub! The Global Masters Advocacy Hub is our customer engagement platform where you will be invited to have some fun completing entertaining challenges, earning badges for the contribution to Developer Community, communicating with other advocates, and accumulating points which you can redeem for a variety of rewards and special honors. In addition to the challenges we prepared special Global Masters rewards for you. How to get rewards? It is simple — just redeem your points and get the reward you want. Here are some prizes from our Rewards Catalog: What's more? There is also Global Masters Leaderboard which counts your advocacy activity and contribution to InterSystems Developer Community. Update:Join Global Masters now: use your InterSystems SSO credentials to access the program. See you on InterSystems Global Masters today! There is a problem with the global masters link - the certificate is invalid. Thanks, Jon!I think I've fixed that I also have a problem with the certificate. Nope, certificate error still remains. Our web security policy blocks access to sites with certificate errors. Error details are as follows VERIFY DENY: depth=0, CommonName "*.influitive.com" does not match URL "globalmasters.intersystems.com" Hi, Stephen!Thanks for the comment!We are looking into that. Should this post be a sticky post on the homepage?Should there be a link to it in main menu? I assume Evgeny's initial fix was to change the hyperlink in the article so it's an http one rather than an https one. Hi,I'd like to join.Cheers,Juergen I would like a join code. Thanks.Stephen No more certificate errors. I believe the issue with the certificate is now resolved. Great! The invitation sent. Hi, Stephen!You are invited! Stephen, are you still using the original https URL Evgeny posted, i.e. https://globalmasters.intersystems.com/ ? My browser still reports an issue with the certificate for that. Hi, John and Steve!The issue is not resolved yet, but would be solved in a few days. Thanks, Jon!The link to Global Masters introduced to the Community menu. I would like a join code too, I'm very interested Hi, Francisco!You're invited! I would like to join :) I would like to join. I would like to join! My e-mail on the community is Amir.Samary@intersystems.com. Hi, Chris! You are invited! Hi, Scott! You are invited! Hi, Amir! You are invited! I'll give it a try! Hi, Jack!You are invited! I would like a join code. Thanks.Dietmar Hi, Deitmar! You are invited! I want to join to gain knowledge on cache. I would like a join code.Thanks Hi, Kishan!You are invited! Hi, Henrique!See the invitation link in your box! I am not able to get in the global masters is there any code to get me log in like that? Hi, Kishan!I sent the personal invitation to your email. Maybe your anti-spam filter is too cruel?Resent it now. I would like a join code. Thanks. Hi, Felix!You are invited! I would like a join code as well. Thanks! If still available I'd like to join.Many thanks! Hi, Stephen!You are invited! Hi, John!It is and you are invited.Welcome to the club! I would like a join code. Thanks. Hi, Charles!You are invited! I'd like to join as well. Thx Hi, Josef!You are invited! I'd like to joinThanks Hi, Thiago!You are invited! I'd like to join! Hi, Anna!You are invited! Welcome to Global Masters! Hi, could I join the Global Masters Lonely Hearts Club Band? Thx. Michal Hi, Michal!Sure! The invitation has been sent. Welcome to the club! ) I'd like to join as well, Evgeny. Thank you. Sure, Jeffrey! You are invited. Hi,I would like to join too ! Hi,I would like to join the community. I have got two invites previously but i couldn't join can you please help me.ThanksKishan R I'd like to join please :) Hi, Paul!You are invited! Hi, Kishan!You are invited! If still available I'd like to join. Hi, Thiago! It is!You are invited! Hi EvgenyCould you send me a join code?RegardsCristiano José da Silva Hi, Cristiano!You are invited! Hi Evgeny,Could you send me again the invitation?Thanks. Hi, Cristiano! Did it again) I'd like to join as well. Thanks :D Hi, Wesley! You are invited! Hi. I'd like to join! Hi, Gilberto!You are invited! Hi, Community!We introduced Single Sign On for Global Masters (GM).So you can use your WRC credentials to join globalmasters now. First time it would also ask you for a GM specific password.How it works:For those who have no active WRC account yet the invite is a way to join! Comment this post to get the personal invite to the Intersystems Global Masters Advocates Hub.And you can use your login and password if you are already a member. Please add me tooPeter Hi, Peter!You are invited! Hi,I am in, can you please add me. Thanks Hi, Aman!You are invited. I'd like to join, Evgeny. Thanks. Thank you Evgeny! Hi, Joe! You are invited!And you can use your WRC account if you want to join GM. Hi,I would like to joinThanks. Hi, Guilherme!You are invited!Also you are able to join with your WRC account, as it is shown here.Welcome to the club! HII'd like to join. Hi, Josnei!You are invited! I would like to join. Thank you i want to join. Very Nice ! :) I will get some informations on the site. Hi, Minsu!Sent you the invite to Global Masters. I want to join to gain knowledge on cache. I want to join to gain knowledge on cache. Hi, Ron!You are invited!And to gain knowledge on InterSystems Caché I recommend you InterSystems online Learning and this Developer Community: ask your questions! Hi,I want join global masters.Thanks Hi, Kuldeep!You are invited. Hi.I'd like to join! Hi, Derek!You are invited! I want to join You are invited! I would like to join Global Masters.Regards I joined Global Masters ages ago, but still can't find a way how to suppress it's notifications. How can I do it? Hi Goran! You are invited Alexey, sorry for disturbing with GM notifications.You can turn it off in Profile settings. See the gif: Evgeny --Thanks, I've already tried it before writing here. My current settings were: Prospect Accepted Unsubscribe from all except privacy, security, and account emailswhile I still received eMails about new challenges, etc. Just tried to turn off "Prospect Accepted", guessing that it can help, but this setting seems to be unswitchable (still active). It is hardly the source of a "problem" as I was never notified on the "prospect" stuff, even don't know its meaning.All these eMails are not a great deal of disturbance, I just dislike when I can't control their frequency. I don't insist on correction, if it causes extra efforts of your team - just sign me off from GM. I would like to Join :) Sounds fun.. May I have the link. Thanks Hi Jimmy!You're invited. Please check you mail! Hi, Thank you for your invitation. Cheers I want to join Global Masters. Thanks! Hi Rayana!You are invited! Hi Rayana,You're invited. Please check you mail! Hi. If it's possible, I would like a join code too.Thanks!Félix Hi Félix,You're invited, please check you mail. Welcome to Global Masters! I would like to join Thanks Evgeny! I did it. Please add me. Hi Suman,You are invited. Welcome to the club! :) Hi Walter,You are invited. Please check you mail! :) Please send an invite, thanks! Hi Drew,Welcome to the club! Please invite me ;) Hi Jan, You're invited. Please check your mail! I would like yo join. Thanks! Hi Daniel, you are invited! Please check your mail I'd like to join Hi Relton, Please check your mail and welcome to the club! 😉 I just got a badge! Evidently a post of mine was added to favorites 10 times. How does one now which post this was though? Best, Mike Hi, Mike! I think we have a problem with this badge. Investigating. Thanks for the feedback! hi, i would like to join to global masters . please guide me. thanks hasmathulla I would like to join. I would like a join code too, I'm very interested.
Announcement
Anastasia Dyubaylo · Mar 23, 2018

Meet InterSystems Developer Community SubReddit!

Hi Community!Please welcome the InterSystems Developer Community SubReddit!Here you will find all the most interesting announcements from InterSystems Developer Community, i.e. useful articles, discussions, announcements and events.A little about Reddit: — is a social news aggregation, web content rating, and discussion website.See how DC SubReddit looks like:Subscribe to the DC SubReddit and maybe it will become one of your favorites!
Announcement
Paul Gomez · Apr 11, 2016

InterSystems Global Summit 2016 - Session Content

Please use the following link to see all Global Summit 2016 sessions and links to additional content, including session materials.https://community.intersystems.com/global-summit-2016
Announcement
Janine Perkins · Apr 13, 2016

Featured InterSystems Online Course: Troubleshooting Productions

Learn how to start troubleshooting productions.Troubleshooting ProductionsLearn how to start troubleshooting productions, with a focus on locating and understanding some of the key Ensemble Management Portal pages when troubleshooting. Learn More.
Announcement
Evgeny Shvarov · Dec 24, 2017

The 2nd Year of InterSystems Developer Community!

Hi, Community!I'm pleased to announce that in this December 2017 we have 2 years of InterSystems Developer Community up and running! Together we did a lot this year, and a lot more is planned for the next year!Our Community is growing: In November we had 3,700 registered members (2,200 last November) and 13,000 web users visited the site in November 2017 (7,000 last year).Thank you for using it, thanks for making it useful, thanks for your knowledge, experience, and your passion!And, may I ask you to share in the comments the article or question which was most helpful for you this year?Happy Birthday, Developer Community! And to start it: for me the most helpful article this year was REST FORMS Queries - yes, I'm using REST FORMS a lot, thanks [@Eduard.Lebedyuk]!Another is Search InterSystems documentation using iKnow and iFind technologiesTwo helpful questions were mine (of course ;):How to find duplicates in a large text fieldand Storage Schema in VCS: to Store Or Not to Store?and How to get the measure for the last day in a month in DeepSee There were many interesting articles and discussions this year. I'd like to thank all of you who participated and helped our community grow. @Murray.Oldfield series on InterSystems Data Platforms Capacity Planning and Performance was a highly informative read.
Article
Mikhail Khomenko · May 15, 2017

Making Prometheus Monitoring for InterSystems IRIS and Caché

Prometheus is one of the monitoring systems adapted for collecting time series data. Its installation and initial configuration are relatively easy. The system has a built-in graphic subsystem called PromDash for visualizing data, but developers recommend using a free third-party product called Grafana. Prometheus can monitor a lot of things (hardware, containers, various DBMS's), but in this article, I would like to take a look at the monitoring of a Caché instance (to be exact, it will be an Ensemble instance, but the metrics will be from Caché). If you are interested – read along. In our extremely simple case, Prometheus and Caché will live on a single machine (Fedora Workstation 24 x86_64). Caché version: %SYS>write $zvCache for UNIX (Red Hat Enterprise Linux for x86-64) 2016.1 (Build 656U) Fri Mar 11 2016 17:58:47 EST Installation and configuration Let's download a suitable Prometheus distribution package from the official site and save it to the /opt/prometheus folder. Unpack the archive, modify the template config file according to our needs and launch Prometheus. By default, Prometheus will be displaying its logs right in the console, which is why we will be saving its activity records to a log file. Launching Prometheus # pwd/opt/prometheus# lsprometheus-1.4.1.linux-amd64.tar.gz# tar -xzf prometheus-1.4.1.linux-amd64.tar.gz# lsprometheus-1.4.1.linux-amd64 prometheus-1.4.1.linux-amd64.tar.gz# cd prometheus-1.4.1.linux-amd64/# lsconsole_libraries consoles LICENSE NOTICE prometheus prometheus.yml promtool# cat prometheus.yml global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.scrape_configs: - job_name: 'isc_cache' metrics_path: '/metrics/cache' static_configs: - targets: ['localhost:57772']# ./prometheus > /var/log/prometheus.log 2>&1 &[1] 7117# head /var/log/prometheus.logtime=«2017-01-01T09:01:11+02:00» level=info msg=«Starting prometheus (version=1.4.1, branch=master, revision=2a89e8733f240d3cd57a6520b52c36ac4744ce12)» source=«main.go:77»time=«2017-01-01T09:01:11+02:00» level=info msg=«Build context (go=go1.7.3, user=root@e685d23d8809, date=20161128-09:59:22)» source=«main.go:78»time=«2017-01-01T09:01:11+02:00» level=info msg=«Loading configuration file prometheus.yml» source=«main.go:250»time=«2017-01-01T09:01:11+02:00» level=info msg=«Loading series map and head chunks...» source=«storage.go:354»time=«2017-01-01T09:01:11+02:00» level=info msg=«23 series loaded.» source=«storage.go:359»time=«2017-01-01T09:01:11+02:00» level=info msg="Listening on :9090" source=«web.go:248» The prometheus.yml configuration is written in the YAML language, which doesn't like tabulation symbols, which is why you should use spaces only. We have already mentioned that metrics will be downloaded from http://localhost:57772 and we'll be sending requests to /metrics/cache (the name of the application is arbitrary), i.e. the destination address for collecting metrics will be http://localhost:57772/metrics/cache. A "job=isc_cache" tag will be added to each metric. A tag, very roughly, is the equivalent of WHERE in SQL. In our case, it won't be used, but will do just fine for more than one server. For example, names of servers (and/or instances) can be saved to tags and you can then use tags to parameterize requests for drawing graphs. Let's make sure that Prometheus is working (we can see the port it's listening to in the output above – 9090): A web interface opens, which means that Prometheus is working. However, it doesn't see Caché metrics yet (let's check it by clicking Status → Targets): Preparing metrics Our task is to make metrics available to Prometheus in a suitable format at http://localhost:57772/metrics/cache. We'll be using the REST capabilities of Caché because of their simplicity. It should be noted that Prometheus only “understands” numeric metrics, so we will not export string metrics. To get the latter, we will use the API of the SYS.Stats.Dashboard class. These metrics are used by Caché itself for displaying the System toolbar: Example of the same in the Terminal: %SYS>set dashboard = ##class(SYS.Stats.Dashboard).Sample() %SYS>zwrite dashboarddashboard=<OBJECT REFERENCE>[2@SYS.Stats.Dashboard]+----------------- general information ---------------| oref value: 2| class name: SYS.Stats.Dashboard| reference count: 2+----------------- attribute values ------------------| ApplicationErrors = 0| CSPSessions = 2| CacheEfficiency = 2385.33| DatabaseSpace = "Normal"| DiskReads = 14942| DiskWrites = 99278| ECPAppServer = "OK"| ECPAppSrvRate = 0| ECPDataServer = "OK"| ECPDataSrvRate = 0| GloRefs = 272452605| GloRefsPerSec = "70.00"| GloSets = 42330792| JournalEntries = 16399816| JournalSpace = "Normal"| JournalStatus = "Normal"| LastBackup = "Mar 26 2017 09:58AM"| LicenseCurrent = 3| LicenseCurrentPct = 2. . . The USER space will be our sandbox. To begin with, let's create a REST application /metrics. To add come very basic security, let's protect our log-in with a password and associate the web application with some resource – let's call it PromResource. We need to disable public access to the resource, so let's do the following: %SYS>write ##class(Security.Resources).Create("PromResource", "Resource for Metrics web page", "")1 Our web app settings: We will also need a user with access to this resource. The user should also be able to read from our database (USER in our case) and save data to it. Apart from this, this user will need read rights for the CACHESYS system database, since we will be switching to the %SYS space later in the code. We'll follow the standard scheme, i.e. create a PromRole role with these rights and then create a PromUser user assigned to this role. For password, let’s use "Secret": %SYS>write ##class(Security.Roles).Create("PromRole","Role for PromResource","PromResource:U,%DB_USER:RW,%DB_CACHESYS:R")1%SYS>write ##class(Security.Users).Create("PromUser","PromRole","Secret")1 It is this user PromUser that we will used for authentication in the Prometheus config. Once done, we'll re-read the config by sending a SIGNUP signal to the server process. A safer config # cat /opt/prometheus/prometheus-1.4.1.linux-amd64/prometheus.ymlglobal: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.scrape_configs: - job_name: 'isc_cache' metrics_path: '/metrics/cache' static_configs: - targets: ['localhost:57772'] basic_auth: username: 'PromUser' password: 'Secret'## kill -SIGHUP $(pgrep prometheus) # or kill -1 $(pgrep prometheus) Prometheus can now successfully pass authentication for using the web application with metrics. Metrics will be provided by the my.Metrics request processing class. Here is the implementation: Class my.Metrics Extends %CSP.REST { Parameter ISCPREFIX = "isc_cache"; Parameter DASHPREFIX = {..#ISCPREFIX_"_dashboard"}; XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ] { <Routes> <Route Url="/cache" Method="GET" Call="getMetrics"/> </Routes> } /// Output should obey the Prometheus exposition formats. Docs: /// https://prometheus.io/docs/instrumenting/exposition_formats/ /// /// The protocol is line-oriented. A line-feed character (\n) separates lines. /// The last line must end with a line-feed character. Empty lines are ignored. ClassMethod getMetrics() As %Status { set nl = $c(10) do ..getDashboardSample(.dashboard) do ..getClassProperties(dashboard.%ClassName(1), .propList, .descrList) for i=1:1:$ll(propList) { set descr = $lg(descrList,i) set propertyName = $lg(propList,i) set propertyValue = $property(dashboard, propertyName) // Prometheus supports time series database // so if we get empty (for example, backup metrics) or non-digital metrics // we just omit them. if ((propertyValue '= "") && ('$match(propertyValue, ".*[-A-Za-z ]+.*"))) { set metricsName = ..#DASHPREFIX_..camelCase2Underscore(propertyName) set metricsValue = propertyValue // Write description (help) for each metrics. // Format is that the Prometheus requires. // Multiline descriptions we have to join in one string. write "# HELP "_metricsName_" "_$replace(descr,nl," ")_nl write metricsName_" "_metricsValue_nl } } write nl quit $$$OK } ClassMethod getDashboardSample(Output dashboard) { new $namespace set $namespace = "%SYS" set dashboard = ##class(SYS.Stats.Dashboard).Sample() } ClassMethod getClassProperties(className As %String, Output propList As %List, Output descrList As %List) { new $namespace set $namespace = "%SYS" set propList = "", descrList = "" set properties = ##class(%Dictionary.ClassDefinition).%OpenId(className).Properties for i=1:1:properties.Count() { set property = properties.GetAt(i) set propList = propList_$lb(property.Name) set descrList = descrList_$lb(property.Description) } } /// Converts metrics name in camel case to underscore name with lower case /// Sample: input = WriteDaemon, output = _write_daemon ClassMethod camelCase2Underscore(metrics As %String) As %String { set result = metrics set regexp = "([A-Z])" set matcher = ##class(%Regex.Matcher).%New(regexp, metrics) while (matcher.Locate()) { set result = matcher.ReplaceAll("_"_"$1") } // To lower case set result = $zcvt(result, "l") // _e_c_p (_c_s_p) to _ecp (_csp) set result = $replace(result, "_e_c_p", "_ecp") set result = $replace(result, "_c_s_p", "_csp") quit result } } Let's use the console to check that our efforts have not been vain (added the --silent key, so that curl doesn't impede us with its progress bar): # curl --user PromUser:Secret --silent -XGET 'http://localhost:57772/metrics/cache' | head -20# HELP isc_cache_dashboard_application_errors Number of application errors that have been logged.isc_cache_dashboard_application_errors 0# HELP isc_cache_dashboard_csp_sessions Most recent number of CSP sessions.isc_cache_dashboard_csp_sessions 2# HELP isc_cache_dashboard_cache_efficiency Most recently measured cache efficiency (Global references / (physical reads + writes))isc_cache_dashboard_cache_efficiency 2378.11# HELP isc_cache_dashboard_disk_reads Number of physical block read operations since system startup.isc_cache_dashboard_disk_reads 15101# HELP isc_cache_dashboard_disk_writes Number of physical block write operations since system startupisc_cache_dashboard_disk_writes 106233# HELP isc_cache_dashboard_ecp_app_srv_rate Most recently measured ECP application server traffic in bytes/second.isc_cache_dashboard_ecp_app_srv_rate 0# HELP isc_cache_dashboard_ecp_data_srv_rate Most recently measured ECP data server traffic in bytes/second.isc_cache_dashboard_ecp_data_srv_rate 0# HELP isc_cache_dashboard_glo_refs Number of Global references since system startup.isc_cache_dashboard_glo_refs 288545263# HELP isc_cache_dashboard_glo_refs_per_sec Most recently measured number of Global references per second.isc_cache_dashboard_glo_refs_per_sec 273.00# HELP isc_cache_dashboard_glo_sets Number of Global Sets and Kills since system startup.isc_cache_dashboard_glo_sets 44584646 We can now check the same in the Prometheus interface: And here is the list of our metrics: We won’t focus on viewing them in Prometheus. You can select the necessary metric and click the “Execute” button. Select the “Graph” tab to see the graph (shows the cache efficiency): Visualization of metrics For visualization purposes, let’s install Grafana. For this article, I chose installation from a tarball. However, there are other installation options, from packages to a container. Let's perform the following steps (after creating the /opt/grafana folder and switching to it): Let's leave the config unchanged for now. On our last step, we launch Grafana in the background mode. We'll be saving Grafan's log to a file, just like we did with Prometheus: # ./bin/grafana-server > /var/log/grafana.log 2>&1 & By default, Grafana’s web interface is accessible via port 3000. Login/password: admin/admin. A detailed instruction on making Prometheus work with Grafana is available here. In short, we need to add a new Data Source of the Prometheus type. Select your option for direct/proxy access: Once done, we need to add a dashboard with the necessary panels. The test sample of a dashboard is publicly available, along with the code of the metrics collection class. A dashboard can be simply imported to Grafana (Dashboards → Import): We'll get the following after import: Save the dashboard: Time range and update period can be selected in the top right corner: Examples of monitoring types Let's test the monitoring of calls to globals: USER>for i=1:1:1000000 {set ^prometheus(i) = i}USER>kill ^prometheus We can see that the number of references to globals per second has increased, while cache efficiency dropped (the ^Prometheus global hasn’t been cached yet): Let's check our license usage. To do this, let's create a primitive CSP page called PromTest.csp in the USER namespace: <html><head><title>Prometheus Test Page</title></head><body>Monitoring works fine!</body></html> And visit it so many times (we assume that the /csp/user application is not password-protected): # ab -n77 http://localhost:57772/csp/user/PromTest.csp We'll see the following picture for license usage: Conclusions As we can see, implementing the monitoring functionality is not hard at all. Even after a few initial steps, we can get important information about the work of the system, such as: license usage, efficiency of globals caching, application errors. We used the SYS.Stats.Dashboard for this tutorial, but other classes of SYS, %SYSTEM, %SYS packages also deserve attention. You can also write your own class that will supply custom metrics for your own application – for instance, the number of documents of a particular type. Some useful metrics will eventually be compiled into a separate template for Grafana. To be continued If you are interested in learning more about this, I will write more on the subject. Here are my plans: Preparing a Grafana template with metrics for the logging daemon. It would be nice to make some sort of a graphical equivalent of the ^mgstat tool – at least for some of its metrics. Password protection for web applications is good, but it would be nice to verify the possibility of using certificates. Use of Prometheus, Grafana and some exporters for Prometheus as Docker containers. Use of discovery services for automatically adding new Caché instances to the Prometheus monitoring list. It's also where I'd like to demonstrate (in practice) how convenient Grafana and its templates are. This is something like dynamic panels, where metrics for a particular selected server are shown, all on the same Dashboard. Prometheus Alert Manager. Prometheus configuration settings related to the duration of storing data, as well possible optimizations for systems with a large number of metrics and a short statistics collection interval. Various subtleties and nuances that will transpire along the way. Links During the preparation of this article, I visited a number of useful sites and watched a great deal of videos: Prometheus project website Grafana project website Blog of one of Prometheus developers called Brian Brazil Tutorial on DigitalOcean Some videos from Robust Perception Many videos from a conference devoted to Prometheus Thank you for reading all the way down to this line! Hi Mikhail, very nice! And very useful.Have you done any work on templating, e.g. so one or more systems may be selected to be displayed on one dashboard? Hi, Murray! Thanks for your comment! I'll try to describe templating soon. I should add it to my plan. For now, an article about ^mgstat is almost ready (in head -)). So stay tuned for more. Hi, Murray!You can read continuation of article here. There templates are used. Hi Mikhail, very nice! I am configure here the process! Where are the metric values stored? What kind of metrics can be added via SetSensor? Only counters or also gauges and histograms? Metrics in this approach are stored in Prometheus. As Prometheus is time-series database, you can store any numeric metric there either counter or gauge. Hum... ok for that part I understand it, but if I extend the %SYS.Monitor.SAM.Abstract (https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GCM_rest) and SetTimer method, do you know where is it stored? I'm not sure, but think that SAM-implementation is based on System Monitor (https://docs.intersystems.com/iris20194/csp/docbook/DocBook.UI.Page.cls?KEY=GCM_healthmon) in some fashion. Could you clarify your task? Do you want to know an exact name of Global where samples are stored? For what?Link you've shared describes how to expose your custom numeric metric that could be read by Prometheus, for instance, and then stored there. 💡 This article is considered as InterSystems Data Platform Best Practice.
Question
Mike Kadow · Jan 15, 2018

Access to the InterSystems Class Database with the Atelier IDE?

How can I access the InterSystems Class Database with the Atelier IDE?Say I want access to the Samples database and Namespace? I'm not clear what you mean by "access the Class Database". Connect Atelier to the SAMPLES namespace and you'll be able to view/edit classes from the SAMPLES database. Please expand on what else you're trying to do. John, maybe I was asking two separate things.When I bring up I/S documentation, there is an option to go to Class Reference.When I select that option I can see all Classes in the InterSystems database, that is what I am really wanting to do.I put the comment in about Samples as an after thought, not really thinking it does not apply to the other question. Ok, I realize I am not being clear, often I say things before I think them through.When I being up I/S documentation, I can select the Class Reference option.From Studio I can look up classes that are in the Class Reference Option.I tried to do the same thing in Atelier, and was unable to find the command to browse through all the Classes I see in the Class Reference Option. That, is what I am trying to do. I hope that is clear. You can also see this information in the Atelier Documentation view as you are moving focus within a class. If you do not see this view you can launch it by selecting Window > Show View > Other > Atelier > Atelier Documentation > Open.For example, I opened Sample.Person on my local Atelier client, selected the tab at the bottom for Atelier Documentation, then clicked on "%Populate" in the list of superclasses. Now I can see this in the Atelier Documentation view: Hey, NicoleThat's excellent !!!What ever I click on shows up in "Atelier Documentation" Tab.Thanks for the hint! Easier:in tab Server Explorer clickk to ADD NEW Sever Connection (green cross) OK, you look for something different than I understood.The CLASS REFERENCE to DocBook seems to be not directly available as in Studio.Just by external access to Documentation ....Part of it is found if you have an class in your editor and move your cursor over a class namethen you get a volatile class description that you can nail down by clicking or <F2>Its's pretty similar to the DocBook version EXCEPT that you have no further references (e.g. Data Types or %Status or ...)So it's not a multi level navigation like in browser!For illustration I have done this for %Persitent. For %Populate, %XML.Adaptor you have do again and again.
Announcement
Andreas Dieckow · Jul 11, 2018

InterSystems products running on AIX on Power 9

InterSystems products (InterSystems IRIS, Caché and Ensemble) support AIX on Power 9 chips starting with:Caché/Ensemble 2017.1.3InterSystems IRIS 2018.1.1
Question
Tony Beukes · Jul 8, 2018

Terminal access to the InterSystems IRIS Experience sandbox

Is Terminal access to the InterSystems IRIS Experience sandbox available? Are you looking for full ssh/bash access into the container, or would an interactive InterSystems Terminal session? To run SQL shell or other database specific commands?Full ssh is difficult as it opens up potential security issues. The InterSystems Terminal would be possible. We have a web accessible version that is in testing right now that we could add.If you clarify what you are looking to do, we can see what meets the needs best.Doug Thanks Doug,It would be great if we could have access via the InterSystems Terminal.Any idea when we could expect it to be available? Good news, we have updated the Direct Access to InterSystems IRIS container to include a terminal link in the management portal.When you get launch your InterSystems IRIS instance, you will get a set of links to that instance. Use the Management Portal link and log in with the username/password provided.Then on the home page of the management portal, you will see a "Terminal" link in the "Links" section. When you click on that link, you will need to enter the username/password again, but then will be in an interactive terminal session that defaults to the USER namespace. This is the same as an iris session iris -U USER at the shell, or the "Terminal" menu option in the launcher.Please let us know if you have any other suggestions or request as we want to make it easy to test out and learn InterSystem IRIS functionality.
Announcement
Anastasia Dyubaylo · Jul 16, 2018

Group: Prague Meetup for InterSystems Data Platform

Hi Community!User or developer working with Caché, Ensemble or other InterSystems products? Healthcare or banking IT professional? Or just a developer seeking new challenges?Come and join us for discussing what's up once you are in Prague, Czech Republic, or near by! We'll share news and experience on how to develop modern big-data, multi-model oriented applications.Please, feel free to ask your questions about InterSystems Meetup group in Prague. @Daniel.Kutac and @Ondrej.Hoferek will provide details.
Announcement
Jeff Fried · Sep 29, 2018

InterSystems Caché and Ensemble 2018.1 Release

InterSystems is pleased to announce that InterSystems Caché and Ensemble 2018 are now released!New in these releases are features that improve security and operations, including:· Key Management Interoperability Protocol (KMIP) support· Microsoft Volume Shadow Copy (VSS) integration· Integrated Windows Authentication support for HTTP· SSH enhancementsThe releases also include many important updates and fixes.See the documentation for release notes and upgrade guides for both Caché and Ensemble. The platforms for these releases are the same as for 2017.2. Full details can be found in this supported platforms document.
Announcement
Mike Morrissey · Mar 7, 2018

InterSystems Launches FHIR® Sandbox at HIMSS18

The InterSystems FHIR® Sandbox is a virtual testing environment that combines HealthShare technology with synthetic patient data and open source and commercial SMART on FHIR apps, to allow users to play with FHIR functionality.The sandbox is designed to enable developers and innovators to connect and test their own DSTU2 apps to multi-source health records hosted by the latest version of HealthShare. Share your experience with others or ask questions here in the FHIR Implementers Group. Click here to access the InterSystems FHIR® Sandbox.