Lines Matching defs:redisServer
704 struct redisServer { struct
706 pid_t pid; /* Main process pid. */
707 char *configfile; /* Absolute config file path, or NULL */
708 char *executable; /* Absolute executable file path. */
709 char **exec_argv; /* Executable argv vector (copy). */
710 int hz; /* serverCron() calls frequency in hertz */
711 redisDb *db;
712 dict *commands; /* Command table */
713 dict *orig_commands; /* Command table before command renaming. */
714 aeEventLoop *el;
715 unsigned lruclock:LRU_BITS; /* Clock for LRU eviction */
716 int shutdown_asap; /* SHUTDOWN needed ASAP */
717 int activerehashing; /* Incremental rehash in serverCron() */
718 char *requirepass; /* Pass for AUTH command, or NULL */
719 char *pidfile; /* PID file path */
720 int arch_bits; /* 32 or 64 depending on sizeof(long) */
721 int cronloops; /* Number of times the cron function run */
722 char runid[CONFIG_RUN_ID_SIZE+1]; /* ID always different at every exec. */
723 int sentinel_mode; /* True if this instance is a Sentinel. */
725 int port; /* TCP listening port */
726 int tcp_backlog; /* TCP listen() backlog */
727 char *bindaddr[CONFIG_BINDADDR_MAX]; /* Addresses we should bind to */
728 int bindaddr_count; /* Number of addresses in server.bindaddr[] */
729 char *unixsocket; /* UNIX socket path */
730 mode_t unixsocketperm; /* UNIX socket permission */
731 int ipfd[CONFIG_BINDADDR_MAX]; /* TCP socket file descriptors */
732 int ipfd_count; /* Used slots in ipfd[] */
733 int sofd; /* Unix socket file descriptor */
734 int cfd[CONFIG_BINDADDR_MAX];/* Cluster bus listening socket */
735 int cfd_count; /* Used slots in cfd[] */
736 list *clients; /* List of active clients */
737 list *clients_to_close; /* Clients to close asynchronously */
738 list *clients_pending_write; /* There is to write or install handler. */
739 list *slaves, *monitors; /* List of slaves and MONITORs */
740 client *current_client; /* Current client, only used on crash report */
741 int clients_paused; /* True if clients are currently paused */
742 mstime_t clients_pause_end_time; /* Time when we undo clients_paused */
743 char neterr[ANET_ERR_LEN]; /* Error buffer for anet.c */
744 dict *migrate_cached_sockets;/* MIGRATE cached sockets */
745 uint64_t next_client_id; /* Next client unique ID. Incremental. */
746 int protected_mode; /* Don't accept external connections. */
748 int loading; /* We are loading data from disk if true */
749 off_t loading_total_bytes;
750 off_t loading_loaded_bytes;
751 time_t loading_start_time;
752 off_t loading_process_events_interval_bytes;
754 struct redisCommand *delCommand, *multiCommand, *lpushCommand, *lpopCommand,
755 *rpopCommand, *sremCommand, *execCommand;
757 time_t stat_starttime; /* Server start time */
758 long long stat_numcommands; /* Number of processed commands */
759 long long stat_numconnections; /* Number of connections received */
760 long long stat_expiredkeys; /* Number of expired keys */
761 long long stat_evictedkeys; /* Number of evicted keys (maxmemory) */
762 long long stat_keyspace_hits; /* Number of successful lookups of keys */
763 long long stat_keyspace_misses; /* Number of failed lookups of keys */
764 size_t stat_peak_memory; /* Max used memory record */
765 long long stat_fork_time; /* Time needed to perform latest fork() */
766 double stat_fork_rate; /* Fork rate in GB/sec. */
767 long long stat_rejected_conn; /* Clients rejected because of maxclients */
768 long long stat_sync_full; /* Number of full resyncs with slaves. */
769 long long stat_sync_partial_ok; /* Number of accepted PSYNC requests. */
770 long long stat_sync_partial_err;/* Number of unaccepted PSYNC requests. */
771 list *slowlog; /* SLOWLOG list of commands */
772 long long slowlog_entry_id; /* SLOWLOG current entry ID */
773 long long slowlog_log_slower_than; /* SLOWLOG time limit (to get logged) */
774 unsigned long slowlog_max_len; /* SLOWLOG max number of items logged */
775 size_t resident_set_size; /* RSS sampled in serverCron(). */
776 long long stat_net_input_bytes; /* Bytes read from network. */
777 long long stat_net_output_bytes; /* Bytes written to network. */
780 struct {
785 } inst_metric[STATS_METRIC_COUNT];
787 int verbosity; /* Loglevel in redis.conf */
788 int maxidletime; /* Client timeout in seconds */
789 int tcpkeepalive; /* Set SO_KEEPALIVE if non-zero. */
790 int active_expire_enabled; /* Can be disabled for testing purposes. */
791 size_t client_max_querybuf_len; /* Limit for client query buffer length */
792 int dbnum; /* Total number of configured DBs */
793 int supervised; /* 1 if supervised, 0 otherwise. */
794 int supervised_mode; /* See SUPERVISED_* */
795 int daemonize; /* True if running as a daemon */
796 clientBufferLimitsConfig client_obuf_limits[CLIENT_TYPE_OBUF_COUNT];
798 int aof_state; /* AOF_(ON|OFF|WAIT_REWRITE) */
799 int aof_fsync; /* Kind of fsync() policy */
800 char *aof_filename; /* Name of the AOF file */
801 int aof_no_fsync_on_rewrite; /* Don't fsync if a rewrite is in prog. */
802 int aof_rewrite_perc; /* Rewrite AOF if % growth is > M and... */
803 off_t aof_rewrite_min_size; /* the AOF file is at least N bytes. */
804 off_t aof_rewrite_base_size; /* AOF size on latest startup or rewrite. */
805 off_t aof_current_size; /* AOF current size. */
806 int aof_rewrite_scheduled; /* Rewrite once BGSAVE terminates. */
807 pid_t aof_child_pid; /* PID if rewriting process */
808 list *aof_rewrite_buf_blocks; /* Hold changes during an AOF rewrite. */
809 sds aof_buf; /* AOF buffer, written before entering the event loop */
810 int aof_fd; /* File descriptor of currently selected AOF file */
811 int aof_selected_db; /* Currently selected DB in AOF */
812 time_t aof_flush_postponed_start; /* UNIX time of postponed AOF flush */
813 time_t aof_last_fsync; /* UNIX time of last fsync() */
814 time_t aof_rewrite_time_last; /* Time used by last AOF rewrite run. */
815 time_t aof_rewrite_time_start; /* Current AOF rewrite start time. */
816 int aof_lastbgrewrite_status; /* C_OK or C_ERR */
817 unsigned long aof_delayed_fsync; /* delayed AOF fsync() counter */
818 int aof_rewrite_incremental_fsync;/* fsync incrementally while rewriting? */
819 int aof_last_write_status; /* C_OK or C_ERR */
820 int aof_last_write_errno; /* Valid if aof_last_write_status is ERR */
821 int aof_load_truncated; /* Don't stop on unexpected AOF EOF. */
823 int aof_pipe_write_data_to_child;
824 int aof_pipe_read_data_from_parent;
825 int aof_pipe_write_ack_to_parent;
826 int aof_pipe_read_ack_from_child;
827 int aof_pipe_write_ack_to_child;
828 int aof_pipe_read_ack_from_parent;
829 int aof_stop_sending_diff; /* If true stop sending accumulated diffs
831 sds aof_child_diff; /* AOF diff accumulator child side. */
833 long long dirty; /* Changes to DB from the last save */
834 long long dirty_before_bgsave; /* Used to restore dirty on failed BGSAVE */
835 pid_t rdb_child_pid; /* PID of RDB saving child */
836 struct saveparam *saveparams; /* Save points array for RDB */
837 int saveparamslen; /* Number of saving points */
838 char *rdb_filename; /* Name of RDB file */
839 int rdb_compression; /* Use compression in RDB? */
840 int rdb_checksum; /* Use RDB checksum? */
841 time_t lastsave; /* Unix time of last successful save */
842 time_t lastbgsave_try; /* Unix time of last attempted bgsave */
843 time_t rdb_save_time_last; /* Time used by last RDB save run. */
844 time_t rdb_save_time_start; /* Current RDB save start time. */
845 int rdb_bgsave_scheduled; /* BGSAVE when possible if true. */
846 int rdb_child_type; /* Type of save by active child. */
847 int lastbgsave_status; /* C_OK or C_ERR */
848 int stop_writes_on_bgsave_err; /* Don't allow writes if can't BGSAVE */
849 int rdb_pipe_write_result_to_parent; /* RDB pipes used to return the state */
850 int rdb_pipe_read_result_from_child; /* of each slave in diskless SYNC. */
852 redisOpArray also_propagate; /* Additional command to propagate. */
854 char *logfile; /* Path of log file */
855 int syslog_enabled; /* Is syslog enabled? */
856 char *syslog_ident; /* Syslog ident */
857 int syslog_facility; /* Syslog facility */
859 int slaveseldb; /* Last SELECTed DB in replication output */
860 long long master_repl_offset; /* Global replication offset */
861 int repl_ping_slave_period; /* Master pings the slave every N seconds */
862 char *repl_backlog; /* Replication backlog for partial syncs */
863 long long repl_backlog_size; /* Backlog circular buffer size */
864 long long repl_backlog_histlen; /* Backlog actual data length */
865 long long repl_backlog_idx; /* Backlog circular buffer current offset */
866 long long repl_backlog_off; /* Replication offset of first byte in the
868 time_t repl_backlog_time_limit; /* Time without slaves after the backlog
870 time_t repl_no_slaves_since; /* We have no slaves since that time.
872 int repl_min_slaves_to_write; /* Min number of slaves to write. */
873 int repl_min_slaves_max_lag; /* Max lag of <count> slaves to write. */
874 int repl_good_slaves_count; /* Number of slaves with lag <= max_lag. */
875 int repl_diskless_sync; /* Send RDB to slaves sockets directly. */
876 int repl_diskless_sync_delay; /* Delay to start a diskless repl BGSAVE. */
878 char *masterauth; /* AUTH with this password with master */
879 char *masterhost; /* Hostname of master */
880 int masterport; /* Port of master */
881 int repl_timeout; /* Timeout after N seconds of master idle */
882 client *master; /* Client that is master for this slave */
883 client *cached_master; /* Cached master to be reused for PSYNC. */
884 int repl_syncio_timeout; /* Timeout for synchronous I/O calls */
885 int repl_state; /* Replication status if the instance is a slave */
886 off_t repl_transfer_size; /* Size of RDB to read from master during sync. */
887 off_t repl_transfer_read; /* Amount of RDB read from master during sync. */
888 off_t repl_transfer_last_fsync_off; /* Offset when we fsync-ed last time. */
889 int repl_transfer_s; /* Slave -> Master SYNC socket */
890 int repl_transfer_fd; /* Slave -> Master SYNC temp file descriptor */
891 char *repl_transfer_tmpfile; /* Slave-> master SYNC temp file name */
892 time_t repl_transfer_lastio; /* Unix time of the latest read, for timeout */
893 int repl_serve_stale_data; /* Serve stale data when link is down? */
894 int repl_slave_ro; /* Slave is read only? */
895 time_t repl_down_since; /* Unix time at which link with master went down */
896 int repl_disable_tcp_nodelay; /* Disable TCP_NODELAY after SYNC? */
897 int slave_priority; /* Reported in INFO and used by Sentinel. */
898 int slave_announce_port; /* Give the master this listening port. */
899 char *slave_announce_ip; /* Give the master this ip address. */
900 char repl_master_runid[CONFIG_RUN_ID_SIZE+1]; /* Master run id for PSYNC.*/
901 long long repl_master_initial_offset; /* Master PSYNC offset. */
903 dict *repl_scriptcache_dict; /* SHA1 all slaves are aware of. */
904 list *repl_scriptcache_fifo; /* First in, first out LRU eviction. */
905 unsigned int repl_scriptcache_size; /* Max number of elements. */
907 list *clients_waiting_acks; /* Clients waiting in WAIT command. */
908 int get_ack_from_slaves; /* If true we send REPLCONF GETACK. */
910 unsigned int maxclients; /* Max number of simultaneous clients */
911 unsigned long long maxmemory; /* Max number of memory bytes to use */
912 int maxmemory_policy; /* Policy for key eviction */
913 int maxmemory_samples; /* Pricision of random sampling */
915 unsigned int bpop_blocked_clients; /* Number of clients blocked by lists */
916 list *unblocked_clients; /* list of clients to unblock before next loop */
917 list *ready_keys; /* List of readyList structures for BLPOP & co */
920 int sort_desc;
921 int sort_alpha;
922 int sort_bypattern;
923 int sort_store;
925 size_t hash_max_ziplist_entries;
926 size_t hash_max_ziplist_value;
927 size_t set_max_intset_entries;
928 size_t zset_max_ziplist_entries;
929 size_t zset_max_ziplist_value;
930 size_t hll_sparse_max_bytes;
932 int list_max_ziplist_size;
933 int list_compress_depth;
935 time_t unixtime; /* Unix time sampled every cron cycle. */
936 long long mstime; /* Like 'unixtime' but with milliseconds resolution. */
938 dict *pubsub_channels; /* Map channels to list of subscribed clients */
939 list *pubsub_patterns; /* A list of pubsub_patterns */
940 int notify_keyspace_events; /* Events to propagate via Pub/Sub. This is an
943 int cluster_enabled; /* Is cluster enabled? */
944 mstime_t cluster_node_timeout; /* Cluster node timeout. */
945 char *cluster_configfile; /* Cluster auto-generated config file name. */
946 struct clusterState *cluster; /* State of the cluster */
947 int cluster_migration_barrier; /* Cluster replicas migration barrier. */
948 int cluster_slave_validity_factor; /* Slave max data age for failover. */
949 int cluster_require_full_coverage; /* If true, put the cluster down if
952 lua_State *lua; /* The Lua interpreter. We use just one for all clients */
953 client *lua_client; /* The "fake client" to query Redis from Lua */
954 client *lua_caller; /* The client running EVAL right now, or NULL */
955 dict *lua_scripts; /* A dictionary of SHA1 -> Lua scripts */
956 mstime_t lua_time_limit; /* Script timeout in milliseconds */
957 mstime_t lua_time_start; /* Start time of script, milliseconds time */
958 int lua_write_dirty; /* True if a write command was called during the
960 int lua_random_dirty; /* True if a random command was called during the
962 int lua_replicate_commands; /* True if we are doing single commands repl. */
963 int lua_multi_emitted;/* True if we already proagated MULTI. */
964 int lua_repl; /* Script replication flags for redis.set_repl(). */
965 int lua_timedout; /* True if we reached the time limit for script
967 int lua_kill; /* Kill the script if true. */
968 int lua_always_replicate_commands; /* Default replication type. */
970 long long latency_monitor_threshold;
971 dict *latency_events;
973 char *assert_failed;
974 char *assert_file;
975 int assert_line;
976 int bug_report_start; /* True if bug report header was already logged. */
977 int watchdog_period; /* Software watchdog period in ms. 0 = off */
979 size_t system_memory_size; /* Total memory in system as reported by OS */