Thank you for your answer Anthony,
No I did not set thread stack size.

Here is my system limits:
fsnode1# limits
Resource limits (current):
  cputime              infinity secs
  filesize             infinity kB
  datasize             33554432 kB
  stacksize              524288 kB
  coredumpsize         infinity kB
  memoryuse            infinity kB
  memorylocked         infinity kB
  maxprocesses             5547
  openfiles               11095
  sbsize               infinity bytes
  vmemoryuse           infinity kB
  pseudo-terminals     infinity
  swapuse              infinity kB

Also for each call I've used MySQL base (via lua script), may be this is the reason.

My odbcinst.ini looks like

[MySQL]
Description=ODBC for MySQL
Driver=/usr/local/lib/libmyodbc3.so
UsageCount=20003

and now I have changed to:
[MySQL]
Description=ODBC for MySQL
Driver=/usr/local/lib/libmyodbc3_r.so
UsageCount=20003
Threading=0

as suggested here.


fsnode1# ldd /usr/local/freeswitch/bin/freeswitch
/usr/local/freeswitch/bin/freeswitch:
        libodbc.so.2 => /usr/local/lib/libodbc.so.2 (0x80064b000)
        libm.so.5 => /lib/libm.so.5 (0x8007bb000)
        libfreeswitch.so.1 => /usr/local/freeswitch/lib/libfreeswitch.so.1 (0x8008db000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x800c56000)
        libz.so.5 => /lib/libz.so.5 (0x800e38000)
        librt.so.1 => /usr/lib/librt.so.1 (0x800f4d000)
        libcrypt.so.5 => /lib/libcrypt.so.5 (0x801052000)
        libssl.so.6 => /usr/lib/libssl.so.6 (0x80116b000)
        libcrypto.so.6 => /lib/libcrypto.so.6 (0x8012be000)
        libncurses.so.8 => /lib/libncurses.so.8 (0x80155e000)
        libjpeg.so.11 => /usr/local/lib/libjpeg.so.11 (0x8016ab000)
        libthr.so.3 => /lib/libthr.so.3 (0x8017e2000)
        libc.so.7 => /lib/libc.so.7 (0x8018fb000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x801b3d000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x801d4d000)

--
Rogoshchenkov Nikolay


On Wed, Aug 7, 2013 at 4:59 PM, Anthony Minessale <anthony.minessale@gmail.com> wrote:
The 98% cpu usage is the catalyst for the error, not the other way around.
You have consumed all your space for threads and the system cannot create any more for some reason.


FreeBSD has chosen to implement their own threading lib a few times and it seems to cause us trouble.
Did you set the thread stack size to 244 before launching?

 



On Wed, Aug 7, 2013 at 3:47 PM, Nikolay Rogoshchenkov <nickolayr@gmail.com> wrote:
Could you please explain what  this mean in FreeSwitch log??? 

----------------------------------------------------------------------
[...]
2013-08-07 23:40:48.011687 [CRIT] switch_core_session.c:1705 Thread Failure!
2013-08-07 23:40:48.011687 [CRIT] switch_core_session.c:1665 LUKE: I'm hit, but not bad.
2013-08-07 23:40:48.011687 [CRIT] switch_core_session.c:1666 LUKE'S VOICE: Artoo, see what you can do with it. Hang on back there....
Green laserfire moves past the beeping little robot as his head turns.  After a few beeps and a twist of his mechanical arm,
Artoo reduces the max sessions to 101 thus, saving the switch from certain doom.
2013-08-07 23:40:48.031685 [CRIT] switch_core_session.c:1705 Thread Failure!
2013-08-07 23:40:48.031685 [CRIT] switch_core_session.c:1665 LUKE: I'm hit, but not bad.
2013-08-07 23:40:48.031685 [CRIT] switch_core_session.c:1666 LUKE'S VOICE: Artoo, see what you can do with it. Hang on back there....
Green laserfire moves past the beeping little robot as his head turns.  After a few beeps and a twist of his mechanical arm,
Artoo reduces the max sessions to 101 thus, saving the switch from certain doom.
2013-08-07 23:40:48.041688 [CRIT] switch_core_session.c:1705 Thread Failure!
[...]
2013-08-07 23:55:38.141571 [CRIT] switch_core_session.c:1705 Thread Failure!
2013-08-07 23:55:38.151578 [CRIT] switch_core_session.c:1705 Thread Failure!
2013-08-07 23:55:38.171584 [CRIT] switch_core_session.c:1705 Thread Failure!
[..]
----------------------------------------------------------------------

It is not funny, at that moment freeswitch consumes 98% of CPU time, and did not response at all.


PS: (Version 1.5.5b git 8d005a4 2013-07-22 14:41:01Z) @FreeBSD 8.2-RELEASE (x64)

--
Nikolay



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org