Mono high cpu usage

Forum Home Forums Uncategorized Issues Mono high cpu usage

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #8446
    JW
    Participant

    I noticed that abnormal high cpu usage of mono happened on some of my projects:
    project 1

    ubuntu 20.04 desktop
    Scada Version 5.8.2
    Mono version 6.10.0.104

    project 2

    ubuntu 20.04 server
    Scada Version 5.8.2
    Mono version no info

    https://drive.google.com/file/d/12O99yqbjY2MZhv7wHoXXSRZk_dOLFJKU/view?usp=sharing

    there are more than 3 mono processes, 2 of them use more than 100% cpu, i suspected to be scadaserver and scadacomm.
    the web page is still accessible.
    the terminal is frozen when open on the server locally.
    can ssh to server and run commands.
    resume normal after system reboot. happened again after months.
    haven’t try whether restarting the services would resumed normal or not.

    #8459
    Mikhail
    Moderator

    www-data user is a web application. You should check operations in ScadaWeb.log before CPU load happened. What users did that time?

    Instead of reboot try restart_apache.sh next time.

    #8463
    JW
    Participant

    Not sure when the high cpu load started. Haven’t check the system since last update 2 months ago until now. Any idea what I should look for?

    Will it effect scada if I kill the www-data PID?

    On the server with ubuntu desktop, I have a chromium browser showing scada dashboard alway on. I found that the chromium is frozen too, but not sure it’s the cause or the result.

    #8464
    JW
    Participant

    The server of project 1 is in production environment, restarting SCADA will trigger an alarm. Since web access from other client browser is still working, I haven’t do anything to it yet.

    other symptoms are very wired. Terminal, File Manager, Chromium are not working. while the desktop gui and other gui apps still working. SSH and teamviewer are still working.

    I am not sure is it the desktop gnome-session problem makes some apps not working, or the high cpu load makes some app not working.

    #8466
    JW
    Participant

    A regular error appeared every day at around 00:00, but doesn’t look like the cause.

    can I avoid this error by refresh the web regularly, e.g. every 1 or 12 or 24 hour(s)?

    2021-02-21 00:00:42 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-02-21 00:00:42 <opticalsensing><www-data><ACT> Connect to SCADA-Server "localhost"
    2021-02-21 00:00:42 <opticalsensing><www-data><ACT> Refresh the tables of the configuration database
    2021-02-21 00:00:43 <opticalsensing><www-data><ACT> Fill input channels properties
    2021-02-21 00:00:43 <opticalsensing><www-data><ACT> Fill output channels properties
    2021-02-21 00:00:43 <opticalsensing><www-data><ACT> Fill input channel statuses properties
    2021-02-21 00:00:43 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:46 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:46 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:46 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:47 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:47 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:48 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:48 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:49 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:50 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:50 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:51 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:51 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:52 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:52 <opticalsensing><www-data><ACT> User information has been added. IP address: ::1. Session: 036AB7C0E285F5A1829AE338
    2021-02-21 00:00:52 <opticalsensing><www-data><ACT> Login without a password: lhp_admin (Dispatcher). IP address: ::1
    2021-02-21 00:00:52 <opticalsensing><www-data><ACT> User information has been updated. IP address: ::1. Session: 036AB7C0E285F5A1829AE338
    2021-02-21 00:00:52 <opticalsensing><www-data><ACT> Retrieve components from the installed plugins
    2021-02-21 00:00:52 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:53 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:53 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:54 <opticalsensing><www-data><EXC> Error getting extended current data by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetCurCnlDataExt (System.String cnlNums, System.String viewIDs, System.Int32 viewID) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    2021-02-21 00:00:54 <opticalsensing><www-data><EXC> Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.
      at Scada.Web.UserMonitor.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x0001d] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.AppData.CheckLoggedOn (Scada.Web.UserRights& userRights, System.Boolean throwOnFail) [0x00006] in <82bda2c3c590430bb1596f945ba003f0>:0 
      at Scada.Web.ClientApiSvc.GetEvents (System.Int32 year, System.Int32 month, System.Int32 day, System.String cnlNums, System.String viewIDs, System.Int32 viewID, System.Int32 lastCount, System.Int32 startEvNum, System.Int64 dataAge) [0x00000] in <82bda2c3c590430bb1596f945ba003f0>:0 
    #8479
    Mikhail
    Moderator

    Will it effect scada if I kill the www-data PID?

    Server and Communicator continue work. So you can try killing the process.
    First, try restarting Apache by restart_apache.sh

    Error getting events by the filter where channels= , view id=1:
    Scada.ScadaException: User not logged on.

    JavaScript on a client page requests for data, but user is logged out. This is not a cause likely.

    Usually when user is logged out, he is redirected to Login.aspx automatically. For some reason he was not redirected. To stop this error, a user should close a webpage or navigate to another page.

    #8480
    Mikhail
    Moderator

    I faced that Mono hangs after heavy operation like opening a chart for a long period.
    We will get rid of Mono and move to .NET5.

    Can you reproduce CPU load?

    #8481
    Mikhail
    Moderator

    Note: Mono may work incorrectly if you open the web app by local browser and also open it remotely by IP address. It’s better to use Linux without GIU.

    #8483
    JW
    Participant

    About the mono issue
    I tried, but haven’t find a way to reproduce it.

    I disabled chart plotting and hide minute data export. So there should be one or more cause other than these 2.

    It happened to one of my server on AWS without GUI a few times. But after I reinstall the whole server, this issue haven’t appear in last 2 months.

    I am going to make a program to monitor the cpu usage by mono, try if I can capture what cause the issue.

    about to the error log above
    What’s the proper way to have a client showing the scada page 7×24?
    when first login:
    – checked “remember me”
    – autologin not installed
    After a long time, the browser seem lost the authentication:
    – the current page data is still refreshing
    – while navigate to other view, the page said user do not have right to access
    – the error log above appears every day 00:00 ever since
    – after refresh the whole page by F5, all view can be accessed

    How long does the browser lose the authentication? Should I have the browser refresh the page regularly to keep the authentication valid?

    #8493
    Mikhail
    Moderator

    I disabled chart plotting and hide minute data export. So there should be one or more cause other than these 2.

    Good idea.

    I am going to make a program to monitor the cpu usage by mono, try if I can capture what cause the issue.

    Probably there should be utilities to read CPU load, provide by SNMP and read by Rapid SCADA.

    #8494
    Mikhail
    Moderator

    What’s the proper way to have a client showing the scada page 7×24?

    It depends more on web server. For example, by default Windows IIS restarts application pool every certain period. It’s possible to disable restarting.

    I haven’t heart that Apache also restarts something. Anyway, after web app restart, you will see break lines (——–) in ScadaWeb.log and then
    2021-02-21 00:00:42 <opticalsensing><www-data><ACT> Initialize common web application data
    How regular such text is in the log?

    #8497
    JW
    Participant

    every day midnight

    #8498
    JW
    Participant

    log from scadaweb, seems reloading every midnight

    2021-03-06 00:00:29 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-07 00:00:25 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-08 00:00:25 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-09 00:00:25 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-10 00:00:11 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-11 00:00:29 <opticalsensing><www-data><ACT> Initialize common web application data
    2021-03-12 00:00:22 <opticalsensing><www-data><ACT> Initialize common web application data

    log from apache2, reloading every mid night too…

    
    Mar 05 00:00:27 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 05 00:00:28 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 06 00:00:25 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 06 00:00:25 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 07 00:00:20 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 07 00:00:21 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 08 00:00:21 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 08 00:00:21 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 09 00:00:21 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 09 00:00:21 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 10 00:00:07 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 10 00:00:07 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 11 00:00:26 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 11 00:00:26 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    Mar 12 00:00:18 opticalsensing systemd[1]: Reloading The Apache HTTP Server.
    Mar 12 00:00:18 opticalsensing systemd[1]: Reloaded The Apache HTTP Server.
    
    #8499
    JW
    Participant

    I found the cause, it was logrotate service.

    the original conf includes reloading apache since the hanlde of log file is changed after logrotate. then it has to reload apache to write to new handle.

    /var/log/apache2/*.log {
    	daily
    	missingok
    	rotate 14
    	compress
    	delaycompress
    	notifempty
    	create 640 root adm
    	sharedscripts
    	postrotate
                    if invoke-rc.d apache2 status > /dev/null 2>&1; then \
                        invoke-rc.d apache2 reload > /dev/null 2>&1; \
                    fi;
    	endscript
    	prerotate
    		if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
    			run-parts /etc/logrotate.d/httpd-prerotate; \
    		fi; \
    	endscript
    }

    I’m testing conf below. “copytruncate” copy to a new file but keeps the old file and truncate old file.

    /var/log/apache2/*.log {
    	copytruncate
    	daily
    	missingok
    	rotate 14
    	compress
    	delaycompress
    	notifempty
    }
    #8504
    Mikhail
    Moderator

    Interesting. Reloading the entire web server just to start new log…
    Does the new approach stop reloading?

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.