1. A method for optimizing performance in a complex event stream (CEP) system, the method comprising: obtaining information about a plurality of CEP threads; determining nearness among the plurality of CEP threads, wherein nearness between a first and a second CEP thread indicates how much interaction is expected to occur between the first and second CEP thread; organizing the plurality of CEP threads into a plurality of CEP thread groups, based on the determined nearness; and assigning each of the plurality of CEP thread groups to a different processing node, each processing node having one or more processors and a memory.