Interrupt signal Control C takes too long to terminate a process

I have a process to terminate, and when keying Control C/ kill -int [processid], it takes 15 minutes to half an hour to terminate the process. I've tried using kill -2, or keying control c twice, however the process seem
to be killed abruptly, without writing into the log file.
So the only way in order to be sure that the process is terminated
safely, is by using control c once or typing kill -int. However I have to
wait so long, for the process to be terminated.

However on another server, the same process is terminated immediately,
using the Control C only once.

Is there a way how the Control C will terminate the process immediately?

Thanks.

A process can catch SIGINT and shut itself down gracefully and it sounds like this process is doing that. If the graceful shutdown takes too long talk to the author of the program. A graceful shutdown can take various amounts of time depending on what the program was doing. You need to get a precise picture of exactly what the program is doing to shut itself down. You then may have some options to provide additional resources to the program. Or you can always just try a much faster computer. Right now your only options are the graceful shutdown and the abrupt shutdown.

Running the process on a faster computer have got worse.

Because when running on a slower computer, the control C have terminated
the process immediatly. However on a faster computer, the control
C took very long to terminate.

Thanks,
Pauline.

Decent programs usually call atexit() to clean up everything and close files, shutdown threads gracefully, etc.

This really sounds more like something the code itself is doing, rather than what the OS or the speed of the computer is doing.

can you tell us more about the program you are running ?
is it a "traditional" program like bash or ls ?

[This program does a lot of inserts into various tables.]

I have no source code of the program and couldn't contact the
author. The only way that I can run this program is through the Unix terminal.
It used to run very fine on the older server. On the older server, the program used to terminate immediately on submitting Control C.

However, on buying another faster server, the program isn't terminating immediately when submitting Control C.

Is it a problem with the configuration of the new server?!

Thanks.

what are the OS of the two computers ?
maybe the program uses some non-portable tricks which slow down the program on the others platforms ?

The operation system is HP Unix

One other suggestion -

The database schema on the old system may have had indexes or other optimizations
that allowed blocking operations (the INTR "ctrl/c" was blocked) to complete faster.
Are the two ( old & new )schemas identical?