- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Apache 2 mod_so on HP_UX 11.11
Operating System - HP-UX
1753421
Members
4907
Online
108793
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2009 08:29 AM
тАО05-28-2009 08:29 AM
Apache 2 mod_so on HP_UX 11.11
I have a software library that runs as a dynamically loaded Apache module. In the operation of the software, processes are forked from the the httpd handler processes in response to certain types of requests.
My intention has been to use the Apache web server provided by HP (Apache/2.0.59 HP-UX_Apache-based_Web_Server). Because the HP supplied Apache is compiled with worker mpm, my library code assumes that it will be called in a multithreaded environment, and uses thread local storage to maintain certain information.
My immediate problem is that on some systems the fork() function fails frequently with ENOMEM. It would seem that the httpd processes have very large working sets, and forking new processes from them must be requiring too much virtual memory.
On examination of things, I discovered that all of the shared libraries being loaded with the LoadModule directive (including mine), are being loaded with text segments being copied to local storage. That would certainly explain unusually large working sets.
I used chatr to check the setting of and to attempt to insure the setting of "+dgb disable", but the behavior does not seem to change. I have also found that on other HP-UX 11.11 systems, the text segments of shared libraries are being used in shared memory, so the behavior on this one system is extremely baffling.
In an attempt to learn more about shared library mapping, I attempted to write my own standalone program to dynamically map my shared library and see if it was behaving similar to the Apache case. I soon discovered that I could neither load my library with dlopen() nor with shl_load(), because the library uses thread local storage (as documented on their respective manual pages). How then does Apache load my module?
I tried building an Apache server from sources and discovered that my own server refuses to load my library due to the TLS restriction in dlopen() and shl_load().
I have concluded that the Apache built by HP has it's own special code to load libraries. Since I have no idea how that code works, I cannot do any further experiments to understand the dynamic of my situation.
Can anyone tell me:
1. why the text segments of my library are being copied to private memory for each process, even though chatr reports "shared library private mapping disabled" (+dbg disable)?
2. how the HP supplied Apache 2 implements the LoadModule command? Is there source code for this version available?
Thank you.
My intention has been to use the Apache web server provided by HP (Apache/2.0.59 HP-UX_Apache-based_Web_Server). Because the HP supplied Apache is compiled with worker mpm, my library code assumes that it will be called in a multithreaded environment, and uses thread local storage to maintain certain information.
My immediate problem is that on some systems the fork() function fails frequently with ENOMEM. It would seem that the httpd processes have very large working sets, and forking new processes from them must be requiring too much virtual memory.
On examination of things, I discovered that all of the shared libraries being loaded with the LoadModule directive (including mine), are being loaded with text segments being copied to local storage. That would certainly explain unusually large working sets.
I used chatr to check the setting of and to attempt to insure the setting of "+dgb disable", but the behavior does not seem to change. I have also found that on other HP-UX 11.11 systems, the text segments of shared libraries are being used in shared memory, so the behavior on this one system is extremely baffling.
In an attempt to learn more about shared library mapping, I attempted to write my own standalone program to dynamically map my shared library and see if it was behaving similar to the Apache case. I soon discovered that I could neither load my library with dlopen() nor with shl_load(), because the library uses thread local storage (as documented on their respective manual pages). How then does Apache load my module?
I tried building an Apache server from sources and discovered that my own server refuses to load my library due to the TLS restriction in dlopen() and shl_load().
I have concluded that the Apache built by HP has it's own special code to load libraries. Since I have no idea how that code works, I cannot do any further experiments to understand the dynamic of my situation.
Can anyone tell me:
1. why the text segments of my library are being copied to private memory for each process, even though chatr reports "shared library private mapping disabled" (+dbg disable)?
2. how the HP supplied Apache 2 implements the LoadModule command? Is there source code for this version available?
Thank you.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-29-2009 03:05 AM
тАО05-29-2009 03:05 AM
Re: Apache 2 mod_so on HP_UX 11.11
>1. why the text segments of my library are being copied to private memory for each process, even though chatr reports "shared library private mapping disabled" (+dbg disable)?
Where are you using chatr(1), on the executable?
>2. how the HP supplied Apache 2 implements the LoadModule command?
It has to call dlopen(3) or shl_load(3), there is no other way.
>my library code assumes that it will be called in a multi-threaded environment, and uses thread local storage
If you were on Integrity, you could use dynamic TLS.
>How then does Apache load my module? ... Since I have no idea how that code works,
I don't see how. You could try using tusc to see what happens.
Where are you using chatr(1), on the executable?
>2. how the HP supplied Apache 2 implements the LoadModule command?
It has to call dlopen(3) or shl_load(3), there is no other way.
>my library code assumes that it will be called in a multi-threaded environment, and uses thread local storage
If you were on Integrity, you could use dynamic TLS.
>How then does Apache load my module? ... Since I have no idea how that code works,
I don't see how. You could try using tusc to see what happens.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2009 03:42 PM
тАО05-31-2009 03:42 PM
Re: Apache 2 mod_so on HP_UX 11.11
HP-UX Apached-based Web Server B.2.0.* and B.2.2.8.* provide
sample module code:
- B.2.0.*: /opt/hpws/apache/build/examples
- B.2.2.8.*: /opt/hpws22/apache/build/examples
They may be helpful to you.
I don't suppose Web Server Suite lab changes the methods to load
modules from the original ASF code.... So if you have Apache
2.0.* or 2.2.* source code, that should give you some helps.
sample module code:
- B.2.0.*: /opt/hpws/apache/build/examples
- B.2.2.8.*: /opt/hpws22/apache/build/examples
They may be helpful to you.
I don't suppose Web Server Suite lab changes the methods to load
modules from the original ASF code.... So if you have Apache
2.0.* or 2.2.* source code, that should give you some helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2009 03:59 PM
тАО05-31-2009 03:59 PM
Re: Apache 2 mod_so on HP_UX 11.11
>uses thread local storage
You could replace hardware TLS by software TLS and use pthread_getspecific(3).
You could replace hardware TLS by software TLS and use pthread_getspecific(3).
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP