Announcement

Collapse
No announcement yet.

Log info

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Log info

    I'm having some occasional slow responses by Apache. The fastest are about 30ms but the slow ones are about 530ms. This is a brand new server that isn't live yet, and this is basically the only thing the server is doing. So I'm trying to track down where the slowness is coming from. I don't think the issue is in mod_lsapi, but I'd like to officially rule that out. Is there any logs for mod_lsapi that would show how long it takes to handle a request?

    I did track the PHP files processing time from start to finish in the PHP script itself and that is always around 30ms. So it seems like the problem is either in Apache or in the connection between Apache and mod_lsapi. It seems suspicious that the difference is consistently around 500ms. It feels like some sort of cache issue somewhere

  • #2
    Hi,

    What the php script is doing? Is it PHP itself or php with connection to mysql?

    The mod_lsapi itself does not provide caching mechanisms directly, but it can work in conjunction with various caching solutions. I guess it is related to the initial start time for a new lsphp process, what you could look at is:

    The lsapi_with_connection_pool: This configuration allows mod_lsapi to maintain a pool of persistent connections to the PHP backend, which can reduce the overhead of establishing new connections for each request.​

    The lsapi_backend_pgrp_max_idle is set to 30 seconds. This means that if there are no requests for 30 seconds, the lsphp parent process will be terminated to free up resources.

    Comment


    • #3
      It does have a connection to mariadb. It's essentially a normal wordpress style (but not actually wordpress) page.

      It does seem like what you describe is happening. Within 30 seconds the requests are quick, after that the next one is slow. I have another lve system that is configured the same way and I never see this happen. Is that because it gets enough constant traffic that the process is never terminated due to the time limit being reached?

      Reading about lsapi_with_connection_pool, the downside is additional memory. Does that scale per account, or is it a one-off expense for the whole server? I'm guessing it's per user since on the live server I see process for each user for lsapi.

      Comment


      • #4
        You are right, for busy websites the initial start should not be an issue since processes will not be terminated.

        Turning on lsapi_with_connection_pool is per server, for all accounts. It could help, but will increase the number of processes in LVE as well as memory usage.

        I would recommend you also to try the CRIU: https://docs.cloudlinux.com/shared/c.../#criu-support .

        Comment


        • #5
          I will look into CRIU.

          But with the connection pool, does the memory scale with more users? So if there are 5 accounts vs 500 accounts, will the memory usage be about the same for those two scenarios or about 100 times different?

          Thanks for your help as always.

          Comment


          • #6
            I believe it will be 100 times different since each backend PHP processes remain active for a certain period.There are two more options to controll this - lsapi_backend_max_idle and lsapi_backend_max_reqs.

            Comment

            Working...
            X