Thanks Florin,
I am trying to integrate the APACHE TRAFFIC SERVER PROXY solution
with VPP using the LD_PRELOAD option.
Initial focus is to bring up using the LD_PRELOAD and later moving it to
Native VCL Library.
Going back to the issue mentioned earlier in the email,
Main thread does not exit before worker threads , as you can see in
the multithreaded simple App code it uses While(1) in Main thread and
waiting
on Accept() System Call. Once the connection is established , create a new
pthread and go back to accept() system calls waiting for a new connection.
I enabled the VCL_DEBUG environment variable , and can see the below log
files whenever I start the Application .
vppcom_app_exit:1389: [173279] Event Log:'/dev/shm/3-173279-vcl-elog'
vppcom_app_exit:1389: [173287] Event Log:'/dev/shm/3-173287-vcl-elog'
Can you please share the tool through which I can decode these files.
I am also seeing one issue where if I mention the max-workers variable in
VCL.CONF, I get the following error.
"vls_app_fork_child_handler:2043: vcl<502944328:-1>: ERROR couldn't
register new worker!"
vcl {
heapsize 64M
segment-size 4000000000
add-segment-size 4000000000
rx-fifo-size 4000000
tx-fifo-size 4000000
max-workers 3
app-scope-local
app-scope-global
app-socket-api /var/run/vpp/app_ns_sockets/default
use-mq-eventfd
}
I am reading the code to decode the o/p of show session verbose.
Thanks
Farooq.J
On Mon, Dec 1, 2025 at 8:01 AM Guo Huiliang via lists.fd.io <huiliang.guo=
[email protected]> wrote:
>
>
> Florin Coras via lists.fd.io <[email protected]>
> 于2025年11月30日周日 07:19写道:
>
>> Hi Farooq,
>>
>>
>> On Nov 29, 2025, at 2:50 AM, farooq basha via lists.fd.io <farooq.juturu=
>> [email protected]> wrote:
>>
>> Hi,
>>
>> I am planning to use the VPP Host stack for the SSL Proxy solution.
>> Currently doing a few prototypes to understand internal details of Host
>> Stack.I have written 2 simple Apps (Server) with POSIX APIs (Please find
>> the attached files).
>>
>>
>> Sounds good but are you on purpose trying to keep the app compatible with
>> both linux and vcl/vpp stacks or is there any other reason why it is not
>> vcl native (directly calls vcl apis)?
>>
>> one is with single threaded and another is with Multi threaded.
>>
>> Client connects the APP and downloads the test.html file.(curl -v
>> http://10.10.10.10:8080/test.html).
>>
>> With a single threaded app able to download the file multiple times
>> without any issue. With a Multithreaded app , able to connect only once and
>> download the file, if I try to connect again
>> it is stuck at TCP-ESTABLISHED state.Not getting HTTP/1.1 GET payload to
>> the application.
>>
>> vpp# show event-logger
>> 5 of 131072 events in buffer, logger running
>> 14991.353354343: lcl: 10.10.10.10:8080
>> 14991.353354689: rmt: 192.168.10.1:42272
>> 14991.353354769: syn-rx: cidx 1 sidx 0 irs 4130977040
>> 14991.353354795: state: syn-rcvd
>> 14991.353558089: state: established
>>
>>
>> I see you found the session debug infrastructure, but a lighter way to
>> debug sessions would be to just use “sh session verbose [2]” cli. The
>> highest level of verbosity will give information about transport and
>> session state, including fifos state, i.e., bytes sent/received and events
>> pending.
>>
>> For instance, if there’s data in the tx fifo, the has_event flag is set
>> and data hasn’t been sent by tcp, that might indicate issue in event
>> propagation.
>>
>>
>> vcl {
>> heapsize 64M
>> segment-size 4000000000
>> add-segment-size 4000000000
>> rx-fifo-size 4000000
>> tx-fifo-size 4000000
>> max-workers 25
>> app-scope-local
>> app-scope-global
>> app-socket-api /var/run/vpp/app_ns_sockets/default
>> use-mq-eventfd
>> }
>>
>>
>> Looks good.
>>
>>
>> session {
>> use-app-socket-api enable
>> evt_qs_memfd_seg
>> }
>>
>>
>> No need for evt_qs_memfd_seg, it’s default now.
>>
>> Am I missing any configuration for Multithreaded App ?
>>
>>
>> Most probable the issue is related to sharing of sessions between
>> threads. VCL wants to pin sessions to threads, for situations when that
>> doesn’t hold because of app usage patterns, the vls layer consumed by ldp
>> handles the detection of threads and the locking. Maybe the fact that main
>> exits potentially before handle_client does any network interaction for vls
>> to properly initiate state is the source of the problem. Does it work if
>> main waits for the worker thread?
>>
>> Should note that if you plan to write a multi-threaded app, most probably
>> you’ll want to add multi-thread-workers to vcl.conf. For vcl native
>> applications, each thread should call vppcom_worker_register.
>>
>> Is there any document where I can find which POSIX calls are supported ?
>>
>>
>> Not explicitly, but you’ll find that we have ci tests that use
>> nginx/envoy/iperf that should be more complex than the ones lower.
>>
>
> Where to find these test data?
>
>>
>>
>> VPP Main thread and APPlication are running on 2 different CPUs.
>> I am using the VPP Latest Version.
>>
>> vpp# show threads
>> ID Name Type LWP Sched Policy (Priority)
>> lcore Core Socket State
>> 0 vpp_main 163832 other (0) 2
>> 0 0
>> 1 vpp_wk_0 workers 163834 other (0) 3
>> 0 0
>> vpp# show version
>> vpp v26.02-rc0~246-gc9d32e020 built by root on ubuntu at
>> 2025-11-29T04:05:56
>>
>> How to enable the debugging logs for VCL? with VPP_VCL_ELOG enabled, did
>> not see the logs.
>>
>>
>> VCL_DEBUG (=level) environment variable. For elogs, it may be possible to
>> do "make build VPP_EXTRA_CMAKE_ARGS=-DVPP_VCL_ELOG=ON”
>>
>> Hope this helps.
>>
>> Regards,
>> Florin
>>
>>
>> Thanks
>> Farooq.
>> <single_thread_app.c><multi_thread_app.c>
>>
>>
>>
>>
>>
>>
>>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26588): https://lists.fd.io/g/vpp-dev/message/26588
Mute This Topic: https://lists.fd.io/mt/116524534/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-