dhairav commented on issue #9625:
URL: https://github.com/apache/trafficserver/issues/9625#issuecomment-1566942545

   Hi @bryancall I have 2 builds of traffic_server binary ready, one is the 
standard one packaged with Debian 11, but I do not know if it is built with 
jemalloc support. Is there any document I can refer to for building 
debs/binaries for Debian?
   I also have a custom compiled from source version of the traffic_server 
binary.
   I have libjemalloc2 installed on the server.
   For enabling the usage of jemalloc - do I need to disable Freelist as you've 
mentioned in your post? Should that be enough or do I need to specify to 
trafficserver anywhere that I want jemalloc to be used instead of the system's 
default `malloc()` and `free`?
   One of the posts I've found suggests an `LD_PRELOAD` of the library when 
running a program where you want to use jemalloc, So I've gone ahead and 
modified the systemctl file to include the Environment variable to preload 
jemalloc like so - 
   
   ```
   #
   #  Licensed to the Apache Software Foundation (ASF) under one
   #  or more contributor license agreements.  See the NOTICE file
   #  distributed with this work for additional information
   #  regarding copyright ownership.  The ASF licenses this file
   #  to you under the Apache License, Version 2.0 (the
   #  "License"); you may not use this file except in compliance
   #  with the License.  You may obtain a copy of the License at
   #
   #      http://www.apache.org/licenses/LICENSE-2.0
   #
   #  Unless required by applicable law or agreed to in writing, software
   #  distributed under the License is distributed on an "AS IS" BASIS,
   #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   #  See the License for the specific language governing permissions and
   #  limitations under the License.
   #
   [Unit]
   Description=Apache Traffic Server is a fast, scalable and extensible caching 
proxy server.
   Documentation=man:traffic_server(8)
   After=network-online.target
   
   [Service]
   Type=simple
   EnvironmentFile=-/etc/default/trafficserver
   Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2"
   PIDFile=/run/trafficserver/manager.lock
   ExecStart=/usr/bin/traffic_manager $TM_DAEMON_ARGS
   ExecReload=/usr/bin/traffic_ctl config reload
   
   [Install]
   WantedBy=multi-user.target
   ``` 
   
   Is the above change enough? Or do I need to add something to 
`/etc/default/trafficserver` as well to get Jemalloc enabled? Also, will the 
above preload (systemd unit file) function properly for the prebuilt Debian 
version or will it only work for my custom --with-jemalloc enabled build?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to