1. A computer-implemented system for optimization of execution of security tasks, the system comprising: a client data collection unit for determining hardware and software configurations of clients detected as being connected to a network; a security module selection unit connected to the client data collection unit for selecting security modules for the clients for subsequent installation of the selected security modules on the clients and on a server; a statistics collection unit that collects security-related statistics from the clients and from the server; and a configuration unit for configuring the installed security modules based on the collected security-related statistics, wherein a security task is executed on a client, if the client has a corresponding installed security module, and the security task is executed on the server, if the client does not have the corresponding security module.