Compile problems using httpd 2.4.x (new API)

2012-03-02
2016-02-21
  • Jens Schleusener

    Hi Pascal,

    to avoid hijacking the "mod_qos on windows" thread I open a new one.

    > Read and respond to this message at:
    > https://sourceforge.net/projects/mod-qos/forums/forum/697421/topic/5080173
    > By: pbuchbinder
    >
    >

    but I have problems to compile mod_qos for httpd 2.4.x

    > I take the dig :) Thanks for participating the forum!!

    Oh, good news. And I must admit that it was a little bit my hope that you
    read that "mini dig" that should naturally mainly an information for other readers ;-)

    But I was not just a lazy mod_qos user: To circumvent compile errors like

    mod_qos.c: In function 'qos_verify_milestone':
    mod_qos.c:1505:7: error: 'conn_rec' has no member named 'remote_ip'

    I played a little bit with changing occurrences of "->remote_ip" into "->client_ip" (don't know if eventually also "->peer_ip" must be used) and that first compile problem itself vanished (no idea of the functionality was still correct).

    But even the next compilation hurdle regarding

    ap_my_generation (is obsolete in 2.4)

    was too high for me as C-layman (although I skimmed http://httpd.apache.org/docs/2.4/developer/new_api_2_4.html).

    So I had currently only two alternatives

    1) using still Apache httpd 2.2.x and the benefits of mod_qos
    or
    2) using the improvements of Apache httpd 2.4.x but abandon mod_qos.

    But now there is a little bit hope for

    3) using the improvements of Apache httpd 2.4.x AND the benefits of mod_qos!

    Regards

    Jens

     
  • Pascal Buchbinder

    a) What features of mod_qos would you like to have within Apache 2.4? Some will be very time intensive to port.
    b) What MPM are you gong to use?

     
  • Pascal Buchbinder

    mod_qos 10.5 compiles with Apache 2.4 BUT:
    1) be careful when using QS_Srv* directives (they probably do not work as expected because connection records are cleared after a quite long time)
    2) QS_SrvMinDataRate is not available (use http://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html instead)

     
    • MyGoul

      MyGoul - 2015-05-29

      Hi Pascal,

      I use mod_qos with Apache 2.4 knowing that i don't use QS_Srv* directives. The only directive i'd like to use is QS_LocRequestLimitDefault. Since i migrate to Apache 2.4 my http instance are unstable and regurlarly cut off with the following error :

      errors.20150528000000.gz:[Thu May 28 12:01:28.088531 2015] [:emerg] [pid 23134:tid 140041544775424] mod_qos(002): failed to create shared memory (ACT)(-): Cannot allocate memory (5824 bytes)

      I have tried to increase the number of shared memory segment on my OS (RHEL 6.0) from 4096 to 8192 but the error still occurs.

      Do you have any idea about the parameters i could change in order to solve this issue ?

      Thanks in advance for your support.
      Sylvain.

       
      • Pascal Buchbinder

        vm.max_map_count is usually (default) set to 64k but I don't know if this is the reason for the error. I suggest to check shared memory usage using the ipcs command.
        Regards, Pascal

         
        • Pascal Buchbinder

          vm.max_map_count is probably the wrong parameter - sorry. It's rather shmmni which is 4k by default indeed. I've never heard that somebody reached this limitation (but ipcs -lm / ipcs -m might show you more information).

           
          • MyGoul

            MyGoul - 2015-06-04

            Thank you for your feedback.

            I have had already checked these parameters and increased some of them but i still have the same behaviour.

            I think i have forgotten to mention the most important information : i'm using mod_event. I have change my configuration to come back to the worker module. Since i have done this change my http instance is stable but i need to observe over a longer period of time.

            I know there is a warning at startup that mention that mod_qos should not be used with mod_event, is it just a warning or is mod_qos absolutly not compatible with this mode ?

            Thanks in adavnce for your support.
            Sylvain

             
            • MyGoul

              MyGoul - 2015-06-04

              Unfortunatly the error still occurs even with the worker_mod. For information, i have the following configuration :

              ------ Shared Memory Limits --------
              max number of segments = 8192
              max seg size (kbytes) = 67108864
              max total shared memory (kbytes) = 17179869184
              min seg size (bytes) = 1

              My http instance loads a lot of proxy balancer definitions (around 300) and i think that they acquire themselves share memory segments. But my instance is stable without mod_qos module, even with a sizing of 4k.

               
              Last edit: MyGoul 2015-06-04
            • Pascal Buchbinder

              mod_qos is developed and tested for Apache 2.2 MPM worker.

              I do some smoke tests using Apache 2.4 MPM worker but it is not fully tested (http://mod-qos.cvs.sourceforge.net/viewvc/mod-qos/src/test24/conf/httpd.conf.tmpl?revision=1.12&view=markup / http://mod-qos.cvs.sourceforge.net/viewvc/mod-qos/src/test24/scripts/)

               
              • Ghostdog

                Ghostdog - 2016-01-14

                Hi,

                I am running into the very same "mod_qos(002): failed to create shared memory (ACT)(-): Cannot allocate memory" error on graceful reloads.

                The more vhosts the server has, the fewer successful gracefuls it will survive.
                It can be reproduced on the latest apache build (2.4.18/event + mod_qos 11.19) by adding more than 500 vhosts and doing gracefuls via apache2ctl.

                Depending on the number of vhosts, the the crash will always occure on the same number of reloads (eg having around 2k vhosts, will allow for 11-12 successful reloads before crashing)

                Btw, the only setting used is the QS_LocRequestsLimitDefault in each vhost.

                Hope you can help me out, as it's an awesome module and I would really love to keep using it.

                Thanks for your work and your support in advance,

                Best regards

                 
                • Pascal Buchbinder

                  yes, ap_mpm_query(AP_MPMQ_GENERATION, &mpm_gen) does no longer work with Apache 2.4... I need to implement a workaround to counter graceful restarts

                   
                  Last edit: Pascal Buchbinder 2016-01-16
                  • Pascal Buchbinder

                    Update: ap_state_query(AP_SQ_MAIN_STATE) and ap_state_query(AP_SQ_CONFIG_GEN) do the job we need to determine the reason why the destructors are called and to access the records to free all resources (semaphores and shared memory).

                     
                    • Pascal Buchbinder

                      mod_qos 11.21 fixes the leak when doing graceful restarts using Apache 2.4.

                       
                      • Ghostdog

                        Ghostdog - 2016-01-18

                        Thank you big time!

                         
    • Dalibor Kouril

      Dalibor Kouril - 2016-02-21

      I have compiled the latest version mod_qos with no problems for Apache 2.4 (Centos 7), but after each graceful restart Apache will increase the number of allocated semaphores. Check ipcs -u.

      Any solution please?

       
      Last edit: Dalibor Kouril 2016-02-21
      • Pascal Buchbinder

        mod_qos increases the shared memory usage at the first graceful restart. This is required as there are still child processes running while the parent process loads the new configuration.

        $ ipcs -us
        ------ Semaphore Status --------
        used arrays = 22
        allocated semaphores = 22
        $ ctl.sh start
        [Sun Feb 21 14:00:56.038625 2016] [mpm_event:notice] [pid 22590:tid 140574038599552] AH00489: Apache/2.4.18 (Unix) OpenSSL/1.0.1f mod_setenvifplus/0.31 mod_qos/11.22 configured -- resuming normal operations
        $ ipcs -us
        ------ Semaphore Status --------
        used arrays = 29
        allocated semaphores = 29
        $ ctl.sh graceful
        [Sun Feb 21 14:01:51.780911 2016] [mpm_event:notice] [pid 22590:tid 140574038599552] AH00493: SIGUSR1 received.  Doing graceful restart
        $ ipcs -us
        ------ Semaphore Status --------
        used arrays = 30
        allocated semaphores = 30
        $ ctl.sh graceful
        [Sun Feb 21 14:02:36.844315 2016] [mpm_event:notice] [pid 22590:tid 140574038599552] AH00493: SIGUSR1 received.  Doing graceful restart
        $ ipcs -us
        ------ Semaphore Status --------
        used arrays = 30
        allocated semaphores = 30
        $ ctl.sh stop
        $ ipcs -us
        ------ Semaphore Status --------
        used arrays = 22
        allocated semaphores = 22
        
         
  • MrCage

    MrCage - 2015-01-06

    So using RequestReadTimeout as replacment of QS_SrvMinDataRate on Apache 2.4 works quite well, but what about disabling this enforcement on a location ()?
    With mod_qos, I can use QS_SrvMinDataRateOffEvent, but if I have to use RequestReadTimeout , this only works on server and virtual host...

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks